Thread: program run , problems

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    6

    program run , problems

    ok whats going on, i i compiled my program, it came back with no errors, but for some reason, when i try to run it, opens and closes instanly, . its really simple, just displays 2 sentences using 2 different strings and im using dev C++

    can someone tell me whats going on,

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Stop running it from the IDE and run it from a console window as intended.

    Or pause with std::cin.get();

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    6
    oh ok, i forgot about the cin.get

    im a noob and the tutorial im using is lacking,

    thx

  4. #4
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Run it from the command prompt. It *is* a console program...
    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;}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help on making program run more efficiently
    By peeweearies in forum C Programming
    Replies: 2
    Last Post: 03-23-2009, 02:01 AM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. Help me with my basic program, nothing I create will run
    By Ravens'sWrath in forum C Programming
    Replies: 31
    Last Post: 05-13-2007, 02:35 AM
  4. Problems with program at work
    By VirtualAce in forum Windows Programming
    Replies: 2
    Last Post: 07-28-2004, 12:08 AM
  5. Replies: 2
    Last Post: 07-15-2004, 06:03 AM