Program 127 #P127 C program File handling : Read from a binary file using fread() Working Code #C256

preview_player
Показать описание

In simple terms, you read one threeNum record of threeNum size from the file pointed by *fptr into the structure num.

You'll get the same records you inserted in Example 3.
|| Like-Comment-Subscribe-Share ||
||Support and Subscribe ||
#rubalsolutions #coding #developer #programming #programmer #technology #clanguage #computerscience #c #informaticpractices #sub #subscribe #youtube #newyoutuber #youtubechannel

To Install Turbo C++ 4.5 Click on Below Link and Download rar file and extract and then install..

Do Like,Comment,Share and Subscribe if u are learning little bit.
Please give me suggestions in form of comment box .

Youtube Gears / devices & equipements
Recording Microphone Mic & Tripod Stand for Laptop
Mini Professional Handheld Microphone Compatible with Xiaomi, Lenovo, Apple, Samsung, Sony, Oppo, Gionee, Vivo Smartphones (One Year Warranty)
********************************************************************
Our Video's Categorized In Different Playlist
*******************************************************************
Playlist for C Programming
*******************************************************************
Playlist for नवरात्रि की 9 कहानी
*********************************************************************
Playlist for Class 6th || CBSE || computer science || Course Book ||
********************************************************************
Playlist for FULL FORMS (Commonly Used Full FORMS )
*******************************************************************
Playlist for Class 5th || CBSE || computer science || Course Book ||
*******************************************************************
Playlist for Class 4th || CBSE || computer science || Course Book ||
*******************************************************************
Playlist for Class 3rd || CBSE || computer science || Course Book ||
******************************************************************
Playlist for Class 2d || CBSE || computer science || Course Book ||
********************************************************************
Рекомендации по теме
Комментарии
Автор

Example 4: Read from a binary file using fread()
#include <stdio.h>
#include <stdlib.h>

struct threeNum
{
int n1, n2, n3;
};

int main()
{
int n;
struct threeNum num;
FILE *fptr;

if ((fptr = fopen("C:\\program.bin", "rb")) == NULL){
printf("Error! opening file");

// Program exits if the file pointer returns NULL.
exit(1);
}

for(n = 1; n < 5; ++n)
{
fread(&num, sizeof(struct threeNum), 1, fptr);
printf("n1: %d\tn2: %d\tn3: %d", num.n1, num.n2, num.n3);
}
fclose(fptr);

return 0;
}

RubalSolutions
Автор

Great 4th lk👍👍👍👍 very helpful video dear. Good job dear👍👍👍🌸🌸🌸🌸

Devendernaturalbeauty
visit shbcf.ru