0

Hi all my friends,

As i'm beginner in VC++, i encountered a lot of problem in debugging.
I think my knowledge and academic studies should be distinguished properly.
I know only c++ but i have OOP knowledge in c programming.
But i am not able to handle the debugging in VC++.
How should i do? :(
I think all my knowledge are mixed ; so stupid:-/

Anyone can help me ,please!:)


//Sequential File Creation

#include<stdio>
#include<iostream>
#include<ctype>
#include<conio>
using namespace std();

struct student
{	int rollno;
	char name[20],nrc[10],add[30];
};


void main()
{FILE *f;
student record;
char ans='Y';
clrscr();


f=fopen("student.dat","wb");

	while(toupper(ans)=='Y')

		{cout<<"Roll No";
		cin>>record.rollno;

		cout<<"\n Name";
		gets(record.name);

		cout<<"\n NRIC No";
		gets(record.nrc);

		cout<<"\n Address";
		gets(record.add);

		fwrite(&record,sizeof(record),1,f);
		cout<<"\n Anymore data(Y/N)?"
		ans=getche():
		}


fclose(f);

}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.