Click here to Skip to main content
15,894,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Serial Number Via USB Pin
David Crow17-Oct-06 8:59
David Crow17-Oct-06 8:59 
AnswerRe: Serial Number Via USB Pin
VonHagNDaz17-Oct-06 9:04
VonHagNDaz17-Oct-06 9:04 
GeneralRe: Serial Number Via USB Pin
VonHagNDaz17-Oct-06 10:34
VonHagNDaz17-Oct-06 10:34 
QuestionRe: Serial Number Via USB Pin
David Crow17-Oct-06 10:51
David Crow17-Oct-06 10:51 
AnswerRe: Serial Number Via USB Pin
VonHagNDaz17-Oct-06 11:07
VonHagNDaz17-Oct-06 11:07 
QuestionCommon File Dialog (SetControlText) - Vista Pin
me17-Oct-06 3:34
me17-Oct-06 3:34 
AnswerRe: Common File Dialog (SetControlText) - Vista Pin
TomJena6-Dec-09 10:16
TomJena6-Dec-09 10:16 
Questionhow do you code for the automatic generation of employee no Pin
paradise_517-Oct-06 3:31
paradise_517-Oct-06 3:31 
The code I used was
#include <iostream.h>
#include<conio.h>
#include<string.h>
#include<fstream.h>
#include<process.h>
class cust
{
// int cuno;
char name[20];
char address[50];
public:
int cuno;
void getdata(fstream &xyz)
{// ifstream ifil("abc.txt");
if (xyz)
{
xyz.seekg(-sizeof(cust),ios::end) ;
cuno=xyz.tellg();
}
else
{ cuno=1;
}
cout<<cuno;
cout<<"enter="" the="" customer="" name";
="" cin="">>name;
cout<<"Enter The Customer Address";
cin>>address;
}

friend class node;
friend class list;
};

class node
{
cust c1;
node *next;
public:
node (cust c2, node *n=NULL)
{
c1.cuno=c2.cuno;
strcpy(c1.name,c2.name);
strcpy(c1.address,c2.address);
next=n;
}
friend class list;
};

class list
{// friend class node;
node *start, *current, *precedence;
public:
list()
{
start=current=precedence=NULL;
}
addnode (cust *c)
{
if ( start ==NULL || c->cuno > start->c1.cuno)
{
start=(c , start);
return(0);
}
node *prv,*curr;

for (prv=curr=start;curr!=NULL &&c->cuno>curr->c1.cuno;prv=curr,curr=curr->next);
node *n = new node (*c,curr);
prv->next=n;
}
void traverse ()
{ cout<<endl<<"good one";
="" for(node="" *temp="start;" temp!="NULL;" temp="temp-">next)
{
cout<<"the student is"<<temp->c1.cuno;
cout<<temp->c1.name;
cout<<temp->c1.address;
}
}
};

void main()
{
clrscr();
list obj;
cust e1;
int c1;
char ch1='y';
while(ch1=='y')
{

cout<<endl<<"enter 1="" for="" entering="" the="" data";
="" cout<<endl<<"enter="" 2="" to="" view="" cin="">>c1;

if (c1==1)
{
fstream ofil("abc.txt",ios::in|ios::out|ios::app|ios::binary);
char rep= 'y';
while (rep== 'y')
{
cout<<"enter the details";
e1.getdata(ofil);
ofil.write((char*)&e1,sizeof(e1));
obj.addnode( & e1);
cout<<"do u wish to continue";
cin>>rep;
}
}
if (c1==2)
{
obj.traverse();
cout<<"bad one";
cout<<e1.cuno;
}
if="" (c1="=0)
{exit(0);" }
cout<<"do="" u="" wann="" to="" continue";
cin="">>ch1;

}
getch();
}
Cry | :((
AnswerRe: how do you code for the automatic generation of employee no Pin
Cedric Moonen17-Oct-06 3:34
Cedric Moonen17-Oct-06 3:34 
AnswerRe: how do you code for the automatic generation of employee no Pin
David Crow17-Oct-06 3:56
David Crow17-Oct-06 3:56 
Questionhow to create two views for one doc in MDI Pin
chethu66517-Oct-06 2:25
chethu66517-Oct-06 2:25 
QuestionConstructing a Tree Pin
llp00na17-Oct-06 1:59
llp00na17-Oct-06 1:59 
AnswerRe: Constructing a Tree Pin
me17-Oct-06 3:52
me17-Oct-06 3:52 
GeneralRe: Constructing a Tree Pin
llp00na17-Oct-06 5:39
llp00na17-Oct-06 5:39 
QuestionRe: Constructing a Tree Pin
David Crow17-Oct-06 3:53
David Crow17-Oct-06 3:53 
AnswerRe: Constructing a Tree Pin
llp00na17-Oct-06 5:46
llp00na17-Oct-06 5:46 
Questionhow resource editor works in Vc++ Pin
AghaJaffer17-Oct-06 1:58
AghaJaffer17-Oct-06 1:58 
AnswerRe: how resource editor works in Vc++ Pin
Mark Salsbery17-Oct-06 6:55
Mark Salsbery17-Oct-06 6:55 
Questionhow resource editor works in Vc++ Pin
AghaJaffer17-Oct-06 1:56
AghaJaffer17-Oct-06 1:56 
QuestionCArchive Pin
Mohammad Khodaii17-Oct-06 1:46
Mohammad Khodaii17-Oct-06 1:46 
AnswerRe: CArchive Pin
David Crow17-Oct-06 2:54
David Crow17-Oct-06 2:54 
Questioncreating a new window Pin
prithaa17-Oct-06 1:25
prithaa17-Oct-06 1:25 
QuestionToolTip Pin
zon_cpp17-Oct-06 1:06
zon_cpp17-Oct-06 1:06 
AnswerRe: ToolTip Pin
Hamid_RT17-Oct-06 1:08
Hamid_RT17-Oct-06 1:08 
AnswerRe: ToolTip Pin
toxcct17-Oct-06 1:34
toxcct17-Oct-06 1:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.