• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Having trouble

## Recommended Posts

It''s been a long while since i made text apps, but i needed to make a console app for a tool, i wanted to make a program to put all the entries into a file so i can view them easy. well this was my first time using msvc++ for a compiler doing console apps, i want to return to the function to allow you to keep inputting records, but when i do it displays infinitly the output text for the main function: i''ll post the code. If you see of any reason it is doing or not doing right, please let me know. #include #include #include #include int main() { ofstream records("record.txt", ios::app); char record[13]; cout<<"Enter new record: "; cin.get(record, 13); records<

##### Share on other sites
One question:

What does this mean:

  records

?

Could u explain what you are trying to do, I can't really understand the situation.

Dark Star
UK

Edited by - Dark Star on August 4, 2001 6:43:21 AM

##### Share on other sites
sorry about that, it got messed up when i posted it, it shouldn't be like that. it should be like this...

int main()
{
ofstream records("record.txt", ios::app);
char record[13];
cout<<"Enter new record: ";
cin.get(record, 13);

records<
main();
}
hope it shows up right
sorry it's still messed up, how do you do the little code blocks?

Edited by - caffeineaddict on August 4, 2001 4:26:05 PM

Edited by - caffeineaddict on August 4, 2001 4:27:48 PM

##### Share on other sites
Here.. try this:
  int main(){ofstream records("record.txt", ios::app);char record[13];do{cout<<"Enter new record: ";cin >> record;records<

• ### Forum Statistics

• Total Topics
627718
• Total Posts
2978792

• 9
• 9
• 21
• 14
• 12