Hello,
I am making a HTML generator, and the user needs to enter the body of thier page. The problem is that DOS doesn't let you enter more then about 3.5 lines. How can I get by this and let them enter as much text as needed?
Thanks
Hello,
I am making a HTML generator, and the user needs to enter the body of thier page. The problem is that DOS doesn't let you enter more then about 3.5 lines. How can I get by this and let them enter as much text as needed?
Thanks
Get the user to store their data in a file first, then read that instead.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Two problems with that...
1) I don't know ho to read files like that.
2) I want it to be done in the program its self.
read it character by character using getch and a string (#include <string>)?
Can you give me an example please?
Or you could read it line by line... something like this:
If you're feeling really ambitious (and have the SGI STL extensions available) you could use a rope instead of a list<string>. Good luck.Code:#include <string> #include <list> #include <iostream> using namespace std; // Get user to input body of page list<string> userBody; string tempLine; cout << "Please enter the body of your page. Press enter twice to exit: "; while (getline(cin, tempLine)) userBody.push_back(tempLine); // userBody now contains the body of the users HTML page.
that will take it in one character at a time, until TERMCHAR (you define it) is reached...Code:#include<iostream.h> int main() { char letter,TERMCHAR; ... while(cin>>letter&&letter!=TERMCHAR) { ... } ... }
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT