C Introduction
Control Statement
- Reverse a String by swapping
- Program to check largest number
- Program to find factor of a number
- Program to find largest number among n numbers
- Program to print multiplication table
- An effective way to use of Else If
- Program to check vowel or not
- Program to find factorial of number
- Program to find the Fibonacci Series
Functions
Array
Pointers
Structure and Union
No Examples found for this topic - CodeHelpPro
Data Files
No Examples found for this topic - CodeHelpPro
Basic Program
In this example, We will learn a simple program for pointer. Before that, You must have knowledge of the following topics.
Few Notes to remember:
*
is used to access the value stored in the pointer variable&
is used to store the address of the given pointer
CODE
#include <stdio.h>
int main()
{
int var = 24; // actual variable declaration
int *p;
p = &var; // storing address of int variable var in pointer p
printf("\n\nAddress of var variable is: %x \n\n", &var);
// address stored in pointer variable
printf("\n\nAddress stored in pointer variable p is: %x", p);
// access the value using the pointer variable
printf("\n\nValue of var variable or the value stored at address p is %d ", *p);
return 0;
}
the output of above code is
Address of var variable is: 61ff18
Address stored in pointer variable p is: 61ff18
Value of var variable or the value stored at address p is 24
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments