Thread: codeblocks gives me strange compiled messages...

  1. #1
    Registered User
    Join Date
    Dec 2019
    Posts
    99

    codeblocks gives me strange compiled messages...

    So, after I code something on codeblocks for C. The window that comes up always differs from one another. So, if I run it once, it will look different from when I run it the second time. How do I fix this?

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    I doubt anyone understands that.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  3. #3
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    Quote Originally Posted by john.c View Post
    I doubt anyone understands that.
    I think you're right

  4. #4
    Registered User
    Join Date
    Dec 2019
    Posts
    99
    Quote Originally Posted by john.c View Post
    I doubt anyone understands that.
    What I mean is that after pressing compile and run. The window that comes up(the black one) is different after each time I close it and open it up again. Does that make more sense?

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    No it doesn't.

    Different how?
    Different position on screen - well, that's windows for you.
    Different contents - well, that's your program.
    Different termination message - maybe your program, if it says anything other than exit status 0.

    Upload a couple of PNG format screen shots to a not-so-spammy image upload site like ImgBB — Upload Image — Free Image Hosting
    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.

  6. #6
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    Quote Originally Posted by solidusMGS View Post
    What I mean is that after pressing compile and run. The window that comes up(the black one) is different after each time I close it and open it up again. Does that make more sense?
    In addition to what Salem said, look at the title of your thread and your message. What does "codeblocks gives me strange compiled messages..." have to do with what you wrote in the message? I can't decipher it

  7. #7
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    solidusMGS?
    More like gaseousMGS!
    Am I right people?!
    People???
    A little inaccuracy saves tons of explanation. - H.H. Munro

  8. #8
    Registered User
    Join Date
    Dec 2019
    Posts
    99
    Quote Originally Posted by john.c View Post
    solidusMGS?
    More like gaseousMGS!
    Am I right people?!
    People???
    This forum reaches from being a dead zone to being alive every so often.

  9. #9
    Registered User
    Join Date
    Dec 2019
    Posts
    99
    Quote Originally Posted by Salem View Post
    No it doesn't.

    Different how?
    Different position on screen - well, that's windows for you.
    Different contents - well, that's your program.
    Different termination message - maybe your program, if it says anything other than exit status 0.

    Upload a couple of PNG format screen shots to a not-so-spammy image upload site like ImgBB — Upload Image — Free Image Hosting

    Yes, it does. You just watch!

    See for yourself: cboard — imgbb.com

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well it seems to me that your attempt to read the "last name initial" failed, because you used "%c" as the format.

    Try instead a leading space in the format.
    Code:
    char initial;
    printf("Enter initial");
    scanf(" %c", &initial); /* space is important! */
    Next time, post your CODE.
    Not vague "the screen is different"

    Oh, and the last 2 lines are just code blocks reporting on whether your program was successful (that's the process returned 0 bit), and the execution time is well what it is - how long the program ran for.
    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.

  11. #11
    Registered User
    Join Date
    Dec 2019
    Posts
    99
    Quote Originally Posted by Salem View Post
    Well it seems to me that your attempt to read the "last name initial" failed, because you used "%c" as the format.

    Try instead a leading space in the format.
    Code:
    char initial;
    printf("Enter initial");
    scanf(" %c", &initial); /* space is important! */
    Next time, post your CODE.
    Not vague "the screen is different"

    Oh, and the last 2 lines are just code blocks reporting on whether your program was successful (that's the process returned 0 bit), and the execution time is well what it is - how long the program ran for.
    Space is important? I read that when writing C it doesn't matter if you use space or not because C can read it anyhow.

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Space is important?
    In printf and scanf format strings it is.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange error messages
    By zatlas1 in forum C Programming
    Replies: 4
    Last Post: 08-30-2015, 05:01 PM
  2. Replies: 1
    Last Post: 03-16-2015, 10:36 AM
  3. compiled c program, got weird error messages
    By Kim Valentin in forum C Programming
    Replies: 10
    Last Post: 10-29-2013, 12:35 PM
  4. Replies: 1
    Last Post: 03-12-2008, 12:10 AM
  5. Strange gcc warning messages with derived classes
    By skewray in forum C++ Programming
    Replies: 5
    Last Post: 09-23-2007, 04:46 AM

Tags for this Thread