We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


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 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 346

Attachments:

Replies to This Discussion

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 

good work bro....

thanks

RSS

Latest Activity

+++!!zυηι кнαη(αм ¢у¢σ) updated their profile
40 minutes ago
Profile Iconjiya chaudhry, Azeem, Falakshair and 11 more joined Virtual University of Pakistan
1 hour ago
Mifa Fadel liked +M.Tariq Malik's discussion SOC101 Introduction to Sociology Assignment 01 Fall 2020 Solution / Discussion
4 hours ago
shifa arshad added a discussion to the group CS605 Software Engineering-II
7 hours ago
shifa arshad joined +M.Tariq Malik's group
7 hours ago
Profile Iconиαвєєℓ αнмє∂ and Ali Fahad joined +M.Tariq Malik's group
8 hours ago
shifa arshad replied to +M.Tariq Malik's discussion MGT502 Organizational Behavior GDB No 01 Fall 2020 Solution / Discussion in the group MGT502 Organizational Behavior
9 hours ago
shifa arshad joined +M.Tariq Malik's group
9 hours ago
+ !! SARAH replied to Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
10 hours ago
+ ᴄᴏғғᴇᴇ updated their profile
10 hours ago
Rizwan Mushtaq joined +M.Tariq Malik's group
10 hours ago
Arooj Shahid liked 乇メ-丂イひり3刀イ.'s discussion *** My Drawing ***
11 hours ago
Arooj Shahid liked 乇メ-丂イひり3刀イ.'s discussion *** الوداع اردو ***
11 hours ago
Arooj Shahid liked Miss. Churhail's discussion LOVE YOUR LIFE!!!!!
11 hours ago
Arooj Shahid liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
11 hours ago
Arooj Shahid liked Omar's discussion Dua
11 hours ago
+!!! ❤️ Shadow Girl❤️!!! liked 乇メ-丂イひり3刀イ.'s discussion *** الوداع اردو ***
12 hours ago
+!!! ❤️ Shadow Girl❤️!!! liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
12 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT201 Financial Management GDB No 01 Fall 2020 Solution / Discussion in the group MGT201 Financial Management
12 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT201 Financial Management GDB No 01 Fall 2020 Solution / Discussion in the group MGT201 Financial Management
12 hours ago

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.