News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Weird output when using Code::Blocks

Started by PsychadelicGumballMachine, May 15, 2022, 05:44:58 PM

Previous topic - Next topic

PsychadelicGumballMachine

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.

Miguel Gimenez

C::B is not a compiler, and this forum is not a general programming board.

You are dereferencing a NULL pointer here:
*pnumber = &number;

Ask elsewhere for more information.