Thread: Problem with Dev-C++.

  1. #1
    Novice.
    Join Date
    Oct 2005
    Posts
    88

    Problem with Dev-C++.

    I've got a little problem with Dev-C++, version 4, latest update. When I write a small program in C, sometimes there seems to be a residue of the code I've previously written.
    e.g.
    Code:
    #include <stdio.h>
    
    main()
    {
    printf("Hi\n");
    getchar();
    }
    prints out 16. Before this program, I made a program which does output 16. Anyone's got an idea to solve this, or knows a good easy to use windows compiler which does not have this problem?
    Thank You.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Do you save the file before trying to compile it?
    Well do you compile it before trying to run it?
    Does it compile without any errors?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Novice.
    Join Date
    Oct 2005
    Posts
    88
    I just press the compile+run button, and there are no compiling errors.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    When it happens, can you press the "compile info" tab, and paste the contents of the log information stored there.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    Try pressing Ctrl+F11 to force it to recompile everything, then press Ctrl+F10 to run the program

  6. #6
    Registered User
    Join Date
    Dec 2005
    Posts
    52
    I think it may be like piaf (palm thing), in that when you press "compile and run" it runs the last program it ran -- not the current one.

    Or maybe not. I wouldn't know about dev-C++ - I use linux.

  7. #7
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Try closing Dev-C++ and restarting, then open the file again and compile. I can't seem to think of any explanation for this problem...

    @Salem: I think you meant the "Compile Log" tab, in the bottom panel.
    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. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  2. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  3. Problem running prog I wrote in Dev C++
    By KidMan in forum C Programming
    Replies: 8
    Last Post: 09-22-2005, 01:50 AM
  4. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM