Thread: my if statements

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    266

    my if statements

    i cant find my problem, it says "missing ) before string"
    but i think i have all my ')' 's

    Code:
    	if((convert == "edit") || (convert == "Edit") || (convert == "EDIT"))
    	{
    	edit_file.open(tfilename.c_str(), ios::app);
    	cho = 1;
    goto theend;
    	}
    	else if((convert == "new") || (convert == "New") || (convert == "NEW"))
    	{
    	new_file.open(tfilename.c_str());
    	cho = 2;
    goto theend;
    	}
    	else if((convert == "read") || (convert == "Read") || (convert "READ"))
    	{
    	read_file.open(tfilename.c_str(), ios::in);
    	cho = 3;
    goto theend;
    	}
    	else if((convert == "exit") || (convert =="Exit") || (convert == "EXIT"))
    	{
    		cho = 4;
    goto theend;
    	}
    o yea, on a side note,,,would this work , right after this
    Code:
    		cho = (int)convert.c_str()[0];
    Last edited by rodrigorules; 11-29-2005 at 12:35 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  2. newbie question - if statements without conditions
    By c_h in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 10:42 AM
  3. C++ If Statements Help
    By moporho in forum C++ Programming
    Replies: 19
    Last Post: 01-18-2008, 08:40 AM
  4. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 11:36 AM
  5. Need help with "if" statements
    By Harryt123 in forum C Programming
    Replies: 22
    Last Post: 05-14-2006, 08:18 AM