NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

problem with _getch()

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
stamprsist



Joined: 14 Mar 2012
Posts: 2

PostPosted: Wed Mar 14, 2012 7:10 pm    Post subject: problem with _getch() Reply with quote

sorry guys i'm new on this forum,
i have a big problem with _getch(), i installed MINGW 5.1.4


my program don't crash but don't do nothing...

int main(int argc, char** argv) {
char x;

printf("ciao\n\n");
x=_getch();

return (EXIT_SUCCESS);
}
Back to top
Anwar
Posted via mailing list.





PostPosted: Wed Mar 14, 2012 8:07 pm    Post subject: problem with _getch() Reply with quote

When I copy-paste the exact program, I get compilation errors as such:

main.cpp:4:21: error:
Back to top
stamprsist



Joined: 14 Mar 2012
Posts: 2

PostPosted: Wed Mar 14, 2012 8:52 pm    Post subject: Reply with quote

try now

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main() {
char x;

printf("ciao\n\n");
x = _getch();

return (EXIT_SUCCESS);
}
Back to top
Paulo R. Panhoto
Posted via mailing list.





PostPosted: Thu Mar 15, 2012 12:45 pm    Post subject: problem with _getch() Reply with quote

As far as I can tell, this code is Microsoft specific.
After some web search, it looks like you'll have to install a library
like pdcurses or a conio port to make it work.

<http://pdcurses.sourceforge.net/>
<http://conio.sourceforge.net/>

Regards,

Paulo

On 14/03/12 17:52, stamprsist wrote:
Quote:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

int main() {
char x;

printf("ciao\n\n");
x = _getch();

return (EXIT_SUCCESS);
}



Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo