Click here to Skip to main content
15,907,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++/CLI Pin
Mark Salsbery29-Oct-06 9:33
Mark Salsbery29-Oct-06 9:33 
GeneralRe: C++/CLI [modified] Pin
Demian Panello29-Oct-06 10:28
Demian Panello29-Oct-06 10:28 
AnswerRe: C++/CLI Pin
Christian Graus29-Oct-06 11:22
protectorChristian Graus29-Oct-06 11:22 
Questionactivate Edit - Copy/Paste Pin
Tara1429-Oct-06 6:16
Tara1429-Oct-06 6:16 
AnswerRe: activate Edit - Copy/Paste Pin
PJ Arends29-Oct-06 10:17
professionalPJ Arends29-Oct-06 10:17 
QuestionMAPI - IAddrBook,calling to function Address(..) to open address book fails Pin
YaronNir29-Oct-06 4:18
YaronNir29-Oct-06 4:18 
AnswerRe: MAPI - IAddrBook,calling to function Address(..) to open address book fails Pin
PJ Arends29-Oct-06 7:18
professionalPJ Arends29-Oct-06 7:18 
QuestionC++ Pin
KOKEMO29-Oct-06 1:31
KOKEMO29-Oct-06 1:31 
Hello all. I have posted what i have done so far Blush | :O

But that is not what i want it to do. i am a newbie to C++ so it would be great if you help me Wink | ;)

What i want to do is to add records to the end of file. that is the records in the file must be like :

David,kurek,Omalley park,566645
Sandra,pegan,John st,5666898
:
:
and so on. the problem is that in this program it does not add the new record to the next line. when i enter the new record it places on the previouse record in the file so u always have one Record being saved on the file Cry | :((
and the next problem is that i want it to receive spaces as well but i cant go it with Get and cin :?

and i hope i can write the rest by knowing what to use from this part :-> cant promise myselfSigh | :sigh:

Please dont write something too complex that i dont underestand cause in that case it would be same as not knowing my answer ... i am still in the beginning of course D'Oh! | :doh:

Thanx and i am waiting Blush | :O

#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<stdlib.h>
#include <io.h>
#include<iomanip.h>
#include<cstdlib.h>
char menu_select();
class stInfo{
public:
char name[80];
char family[80];
char address[80];
char stID[40];

};

// Functions

class functions{
public:
// list of functions
void add_rec();
};


void functions::add_rec(){

stInfo student;
//char *p = student.name;
char ch;



ifstream out_stream("f:rec.dat",ios::out| ios::binary);
out_stream.seekg (0, ios::end);

if(!out_stream) cout<<"cannot open file";
do{

out_stream.get(ch);
if (ch=='$')
{
cout<< "name: ";
cin>>student.name;
cout<<"\n";

cout<< "Family name: ";
cin>>student.family;
cout<<"\n";

cout<< "Address: ";
cin>>student.address,80;
cout<<"\n";

cout<< "student ID: ";
cin>>student.stID;
cout<<"\n";
//out_stream.seekg(eof);
ofstream out_stream("f:rec.dat");
out_stream<
AnswerRe: C++ Pin
Michael Dunn29-Oct-06 1:59
sitebuilderMichael Dunn29-Oct-06 1:59 
Questionsetting symbolic name to functions and methods Pin
mt_samiei28-Oct-06 20:21
mt_samiei28-Oct-06 20:21 
QuestionWhich edit box was clicked? [modified] Pin
Oliver12328-Oct-06 19:20
Oliver12328-Oct-06 19:20 
AnswerRe: Which edit box was clicked? Pin
PJ Arends28-Oct-06 21:25
professionalPJ Arends28-Oct-06 21:25 
GeneralRe: Which edit box was clicked? Pin
Oliver12329-Oct-06 13:18
Oliver12329-Oct-06 13:18 
AnswerRe: Which edit box was clicked? Pin
Mark Salsbery29-Oct-06 14:28
Mark Salsbery29-Oct-06 14:28 
QuestionOwner Drawn Pin
BlitzPackage28-Oct-06 13:28
BlitzPackage28-Oct-06 13:28 
AnswerRe: Owner Drawn Pin
Christian Graus28-Oct-06 13:37
protectorChristian Graus28-Oct-06 13:37 
GeneralRe: Owner Drawn Pin
BlitzPackage28-Oct-06 13:41
BlitzPackage28-Oct-06 13:41 
GeneralRe: Owner Drawn Pin
Jörgen Sigvardsson29-Oct-06 9:17
Jörgen Sigvardsson29-Oct-06 9:17 
AnswerRe: Owner Drawn Pin
peterchen29-Oct-06 4:18
peterchen29-Oct-06 4:18 
QuestionRasSetEntryProperties runtime error. Access Violation Pin
cfo5ter28-Oct-06 11:11
cfo5ter28-Oct-06 11:11 
AnswerRe: RasSetEntryProperties runtime error. Access Violation Pin
PJ Arends28-Oct-06 11:46
professionalPJ Arends28-Oct-06 11:46 
AnswerRe: RasSetEntryProperties runtime error. Access Violation Pin
PJ Arends28-Oct-06 11:56
professionalPJ Arends28-Oct-06 11:56 
GeneralRe: RasSetEntryProperties runtime error. Access Violation Pin
cfo5ter28-Oct-06 12:40
cfo5ter28-Oct-06 12:40 
GeneralRe: RasSetEntryProperties runtime error. Access Violation Pin
PJ Arends28-Oct-06 12:49
professionalPJ Arends28-Oct-06 12:49 
GeneralRe: RasSetEntryProperties runtime error. Access Violation Pin
cfo5ter28-Oct-06 13:19
cfo5ter28-Oct-06 13:19 

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.