User Profile

Collapse

Profile Sidebar

Collapse
windscar
windscar
Last Activity: Feb 27 '10, 08:45 PM
Joined: Feb 22 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hello everybody,

    Finally with some experiments, I can make the getchar() works as my expectation. By putting getchar() and cin.get() together. So, my code becomes like this:
    Code:
    #include <ncurses.h>
    #include <iostream>
    	using namespace std;
    #include <stdlib.h>
    
    void menu();
    
    int main() {
    	int stop(0);
    	int choice;
    	
    	while (stop == 0) {
    ...
    See more | Go to post

    Leave a comment:


  • c++: getchar() doesn't work on conditional control statement

    Hello Everybody!

    I am a beginner that try to learn C++ programming. I work in Linux Ubuntu Karmic Koala (9.10) environment.

    I got a problem with getchar(). The function works well in a simple program. But when I use it in while (cond.) and switch (var.) , the function doesn't work, it doesn't even ask me to input character (including "\n"). Or maybe there are other reasons why getchar() doesn't work.
    ...
    See more | Go to post
No activity results to display
Show More
Working...