what do these errors mean?

This is a discussion on what do these errors mean? within the C++ Programming forums, part of the General Programming Boards category; c:\docume~1\owner\mark\untitl~1.cpp: In function `int main()': c:\docume~1\owner\mark\untitl~1.cpp:7: ANSI C++ forbids comparison between pointer and integer c:\docume~1\owner\mark\untitl~1.cpp:11: ANSI C++ forbids comparison between ...

  1. #1
    markdogg2
    Guest

    what do these errors mean?

    c:\docume~1\owner\mark\untitl~1.cpp: In function `int main()':
    c:\docume~1\owner\mark\untitl~1.cpp:7: ANSI C++ forbids comparison between pointer and integer
    c:\docume~1\owner\mark\untitl~1.cpp:11: ANSI C++ forbids comparison between pointer and integer

    code is this-

    #include <iostream.h>
    int main()
    {
    char thisisnotanumber;
    cout<<"Am I bad ass?";
    cin>>thisisnotanumber;
    if(thisisnotanumber=="yes")
    {
    cout<<"Damn Straight!";
    }
    else if(thisisnotanumber=="no")
    {
    cout<<"Well you're wrong, I am bad ass.";
    }
    else
    {
    cout<<"It's a yes or no question genius.";
    }
    return 0;
    }

  2. #2
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    #include <iostream.h>
    #include <string.h>

    int main()
    {
    char thisisnotanumber[256];
    cout<<"Am I bad ass?";
    cin>>thisisnotanumber;
    if(!strcmp(thisisnotanumber,"yes"))
    {
    cout<<"Damn Straight!";
    }
    else if(!strcmp(thisisnotanumber,"no"))
    {
    cout<<"Well you're wrong, I am bad ass.";
    }
    else
    {
    cout<<"It's a yes or no question genius.";
    }
    return 0;
    }

  3. #3
    markdogg2
    Guest
    thanks a lot man, perfect

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. Unknown Errors in simple program
    By neandrake in forum C++ Programming
    Replies: 16
    Last Post: 04-06-2004, 02:57 PM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21