News:

Welcome to RetroCoders Community

Main Menu

C INT Pointers Exercise

Started by stigma, Jan 20, 2023, 01:19 AM

Previous topic - Next topic

stigma

Pointers Excercise!

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

int main()
{
	int number =0;
	int * pnumber = NULL;
	
	number = 46;
	pnumber = &number;
	
	printf("the address of number %p\n", &number);
	printf("int pointer address %p\n", pnumber);
	printf("int pointer value - the address of the pointer itself %p\n", &pnumber);
	printf("int pointer points to the value of - the value that it's pointing to %d\n", *pnumber);
	printf("int number size is %d", sizeof(pnumber));
	
	return 0;
}

stigma