Thread: So annoying. How to do it?

  1. #16
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by Hugo716
    Well, cin.get dont work on this. how come?
    Perhaps you could provide slightly more information other than "dont work".
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  2. #17
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    You have to understand, hugo, that everyone here is trying to avoid answering this question for the 1000000000th time.
    Sent from my iPadŽ

  3. #18
    Registered User
    Join Date
    Apr 2006
    Posts
    132
    it just asks for your name. you type it and hit enter and it exits. doesnt show result and pause.

    any ideas?

  4. #19
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    operator >> leaves '\n' in the input stream. your call to get pulls it out and doesn't wait like you expected it to. ignore() or loop until the junk is gone.

  5. #20
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Ah, running from an IDE.

    Use one std::cin.get(); to suck up the leftover newline and a second std::cin.get(); to pause.

    Or use getline(std::cin, Name); instead of std::cin>>Name;.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  6. #21
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Today's kids are too lazy to run programs from the command prompt anymore. Miss the old days...
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  7. #22
    C++ Newbie
    Join Date
    Nov 2005
    Posts
    49
    Quote Originally Posted by jafet
    Today's kids are too lazy to run programs from the command prompt anymore. Miss the old days...
    I would if I knew where to find it, do it through MS-DOS? What about on Mac OS and Linux?

    We newbies are still learning, so it's better to put off writing makefiles and allsorts and run everything through command prompt. Saves a bit of time, and more focus on the important stuff, once that's done then go back onto the thing.

  8. #23
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    START > Run > cmd
    Sent from my iPadŽ

  9. #24
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Or go with the tools that can make the difference...

    Command Prompt Explorer Bar. It's free, It's cool. It's so sexy it makes me cry. You are going to love it.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  10. #25
    Registered User
    Join Date
    May 2006
    Location
    uk
    Posts
    14
    even tho im still a noob at C++ i only use the command prompt never the IDE

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Annoying people on-line is now a crime...
    By novacain in forum A Brief History of Cprogramming.com
    Replies: 30
    Last Post: 01-12-2006, 09:42 PM
  2. Annoying bug I can't find or fix!
    By homeyg in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2004, 12:13 AM
  3. Yahoo! mail is bieng soooo annoying !!!!
    By Brain Cell in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 11-08-2004, 03:23 PM
  4. Beating stick of annoying people
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 05-27-2004, 04:00 PM