Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: PsychadelicGumballMachine on May 15, 2022, 05:44:58 pm

Title: Weird output when using Code::Blocks
Post by: PsychadelicGumballMachine on May 15, 2022, 05:44:58 pm
I am pretty new to C Programming and was practicing using pointers.  Here's the code I had:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int number = 15;
    int *pnumber = NULL;

    *pnumber = &number;

    printf("%p\t %p\t %d.", (void*)&pnumber, pnumber, *pnumber);
    return(0);
}

However upon running the program, I got this:
 0 [main] Untitled1 1556 cygwin_exception::open_stackdumpfile: Dumping stack trace to Untitled1.exe.stackdump

Process returned 35584 (0x8B00)   execution time : 0.070 s
Press any key to continue.

I don't know what this means and it appears to have nothing to do with what I wrote.  Any help would be greatly appreciated.
Title: Re: Weird output when using Code::Blocks
Post by: Miguel Gimenez on May 15, 2022, 06:13:07 pm
C::B is not a compiler, and this forum is not a general programming board.

You are dereferencing a NULL pointer here:
Code
*pnumber = &number;
Ask elsewhere for more information.