This is a vary simple program in c++ i shared below. i hope you can easily understand the concept of pointer that what is a pointer? what does pointer ? and how to use pointer ? See the example given below for more detail please ask question in comments.
#include<iostream>// pre-processor directive iostream.h is a header file
using namespace std; // we are using standered keyword and expressions
main(){
cout"Facebook : hamidj3\n\n";
cout"Email: badshah.hazor@gmail.com\n";
// what is point?
// pointer is a spacial kind of variable that is used to store the addresses of memory
int var=10;
// an integer type variable initialized
int *add;
// a pointer decleared
add= &var;
// &var will show the address of variable and now we are assigning the address to add pointer
cout"Memory address of var :"addendl;
// this is print the memory address of variable
cout"Value that is stored inside the memory address :"*addendl;
// this will printed the stored value inside the memory like var = 10 so 10 will be printed
cout"\n";
system("pause");// this is a built-in function that is use to stop the console window for long
}
If the above code doesn't work then you may also download the attachment file given below
Tags:
what does int*add meanz????????
it means this is a pointer variable that will store the memory address
sorry
explain plzzz
int * add is a pointer that will be used to store the memory address. memory address is a locations where we store values (information) like
int x=10;
int is a data type mean to say we will store the integer into the x variable and 10 is a value that will be stored inside the x variable this x variable is a name of memory and it has an address we can print the memory address by putting an ampersand (&) before the x that will look like &x. so memory address can be fx00x11. now we need a spacial variable to store this fx00x11 where we can store this as this is a hexadecimal value. for this purpose we will declare a pointer variable.
int staric variablename (int *add) here add= address and you may use any name instead of this add . you may use *y
thanks
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post