Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 getch: argument is wrong type
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
someone




PostPosted: Sat Jun 03, 2006 3:51 pm   Post subject: getch: argument is wrong type

hey guys... i don't really get this .... when i used the getch command.. this is what happens... can anyone help me? Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sat Jun 03, 2006 5:17 pm   Post subject: (No subject)

What happens?
Null




PostPosted: Sat Jun 03, 2006 5:20 pm   Post subject: (No subject)


  • This is the tutorials section. The correct forum is right above this one. Use your eyes.

  • I don't think getch is standard. Try using std::cin.get()

    eg:

    code:

    #include <iostream>

    int main() {
            char ch;
            std::cout << "Enter a character: ";
            ch = std::cin.get();

            std::cout << "You entered " << ch << std::endl;
    }

[Gandalf]




PostPosted: Sat Jun 03, 2006 6:00 pm   Post subject: (No subject)

If I recall correctly, getch() is a standard C method, which can probably be found in <cstdio>, or if you are using C, stdio.h.
Flikerator




PostPosted: Tue Jun 06, 2006 12:04 pm   Post subject: (No subject)

[Gandalf] wrote:
If I recall correctly, getch() is a standard C method, which can probably be found in <cstdio>, or if you are using C, stdio.h.


Wouldn't it be C++ for stdio.h?
wtd




PostPosted: Tue Jun 06, 2006 12:16 pm   Post subject: (No subject)

The stdio.h header is a C header file. C++ and C are different languages that just happen to be mostly compatible. The "cstdio" C++ header exists to wrap stdio.h up so you don't have to worry about the differences between C and C++ when you use it.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: