Thread: Codeblocks crashes

  1. #1
    Registered User
    Join Date
    Sep 2018
    Posts
    5

    Codeblocks crashes

    Hello everyone i started programming in c very recently however ,since today everytime i try to compile a program how simple it may be codeblocks crashes and i get this info in CMD Process returned -1073741819 (0xC0000005)

    Exemple :

    Code:
    int main()
    {
    int m,n,a;
    do
    {
        printf("enter the value of m \n",m);
        scanf("%d",&m);
        printf("enter the value of n \n",n);
        scanf("%d",&n);
        printf("enter the value of a \n",a);
        scanf("%d",&a);
    } while (m<1 ||  n<1 || a<1 );
    
    
    }

  2. #2
    Registered User
    Join Date
    Jul 2018
    Posts
    6
    Have you installed gcc or g++? what is your OS? maybe in windows you need MINGW

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,998
    Quote Originally Posted by Kerrons
    Hello everyone i started programming in c very recently however ,since today everytime i try to compile a program how simple it may be codeblocks crashes and i get this info in CMD Process returned -1073741819 (0xC0000005)
    I suggest that you try to compile and run this program:
    Code:
    #include <stdio.h>
    
    int main(void)
    {
        printf("Hello world!\n");
        return 0;
    }
    Does Code Blocks still crash? Note that when you say that Code Blocks crashed, it means that the IDE itself stopped working, not that say, your program compiled but crashed when you tried to run it.

    As for the program that you posted, this is wrong:
    Code:
    printf("enter the value of m \n",m);
    It should have been:
    Code:
    printf("enter the value of m \n");
    The same goes for the other two printf calls.

    You also should #include <stdio.h> at the top of the file.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Sep 2018
    Posts
    5
    thank you as you said by removing the extra ",m" it worked correctly

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CodeBlocks crashes
    By huviline in forum C++ Programming
    Replies: 1
    Last Post: 01-13-2015, 03:27 PM
  2. Need help with codeblocks
    By SilverClif in forum Windows Programming
    Replies: 6
    Last Post: 05-24-2011, 05:12 AM
  3. Replies: 8
    Last Post: 05-20-2011, 04:22 AM
  4. using codeblocks
    By torquemada in forum Tech Board
    Replies: 7
    Last Post: 04-20-2011, 08:57 PM
  5. Codeblocks crashes linux?
    By Shakti in forum Tech Board
    Replies: 1
    Last Post: 03-25-2009, 07:26 AM

Tags for this Thread