FILE2 - fprintf(stream, "\nId:%d \nName:%d ",s,q);

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <stdio.h> void main() { FILE *stream; int s,q,i,j; clrscr(); printf("Enter "); scanf("%d%d",&s,&q); stream = fopen("c.txt", "w+"); fwrite(&s, sizeof(s), 1, stream); fwrite(&q, sizeof(q), 1, stream); fseek(stream, SEEK_SET, 0);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fprintf(stream, "\nId:%d \nName:%d ",s,q); fscanf(stream,"%d%d",i,j); // fread(&q, sizeof(s), 1, stream); printf("\nID:%d \nNAME:%s",i,j); fclose(stream); getch(); }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM3 taught by Professor Thakur during the Fall '07 term at University of Mumbai.

Ask a homework question - tutors are online