« first day (893 days earlier)      last day (1535 days later) » 

02:02
hey guys, issit a good idea to have menu inside a function and then calling that function from another menu
@JoelSeah A menu where you get to choose a function to call ?
@AmberRoxanna yes. and then from inside that function. display another set of menu options to again call another function
@JoelSeah I don't see why that would be a bad idea. It looks like you're building an interactive program and that's pretty standard. But i'll wait till the experts come in on your question and destroy my response to your inquiry.
@AmberRoxanna maybe.haha but then the function goes into a inifinite loop after calling from the menu.
@JoelSeah then you have a problem with that particular function you called. we would need to see the code for that function to see why it's stuck in an infinite loop.
02:12
this is the code which i call from my 2nd menu inside a function:
void School::displayAllAcc(int choice) {
fstream checkDatabase;
vector <AccDetails> accInfo;
AccDetails user;

switch(choice) {
case 1:
checkDatabase.open("StudentDatabase.txt");
break;
case 2:
checkDatabase.open("LecturerDatabase.txt");
break;
}
string line = "";
if (checkDatabase.is_open()) {

checkDatabase.seekp(0,ios::end);
size_t size = checkDatabase.tellg();
checkDatabase.seekp(0,ios::beg);
if (size == 0)
cout << "Empty file!" << endl;
else {
showHeader(cout,choice);
while (getline(checkDatabase,line)) {
@JoelSeah please use pastebin or a similar site instead of dropping huge code snippets
Hehe. Lounge greeted me with a nice large block of code. :)
alright will do that the next time
@JoelSeah I'm sorry, you've surpassed me in my C++ knowledge. I can't help you with this one. :(
@AmberRoxanna lol. thanks anyway ^^
02:16
@Borgleader
it's Lightness's new project for where to get C++ help
oh i dont actually care that he posts it in the lounge, i just care that it's inline and takes half the screen.
a pastebin/ideone/coliru/... link would be better
sorry. i cant seem to delete that particular msg
too late now, you only have a 3 min window to edit
02:19
21 messages moved from Lounge<C++>
 
8 hours later…
09:49
1 message moved from PHP
 
12 hours later…
Xeo
Xeo
1 message moved from Lounge<C++>

« first day (893 days earlier)      last day (1535 days later) »