Pointer In C++:-
In this article I have explained Pointer in c++ in detail with effective way.You will like it , I know about it. So enjoy it lovely friends. The concept of pointer in c++ is most important to get c++ in detail.
Pointer:-
It is a variable contains the address of another variable of same type. Pointer is a special type of variable.
If we want to Store the address of ’int’ Type variable then we have to take ‘int’ type of pointer variable.
Pointer Variable Declaration Statement:-
Syntax ,
DataType * VariableName;
In this Statement, we declare the data type and the name of a Pointer variable.
Example,
int *ptr;
Initialization of a Pointer:-
To initialize a Pointer variable, first of all we have to declare the same type of a Simple variable.
Example,
int a;
a=10;
Now we have to do initialization of example Pointer,
ptr=&a;
By above Statement ’ptr’ is initialized,the address of variable ‘a’
If we want to display the value of a then we can write,
cout<<*ptr;
Output, 10
By above example it is declared that Pointer ‘ptr’ now indicating the variable ‘a’ and showing the value of a.
//Program to show the use of a pointer.
#include<iostream.h>
#include<conio.h>
void main ()
{
clrscr ();
int a,*ptr;
a=5;
ptr=&a;
cout<<”the value of variable”<<a;
cout<<” The value of a variable by pointer”<<*ptr;
cout<<”The address of a variable “<<ptr;
getch();
}
Output:-
The value of variable:-5
The value of a variable by Pointer:-5
The address of a variable:- EH5326 (It may any address)
Address of operator (&):-
The operator is used to get the address of a variable. If we want to get the address of a variable namely ‘a’ then we have to write the following Statement.
&a
After this we put it into the same type of variable of Pointer type.
ptr=&a;
Assignment Operator(=):-
This operator is used to assign a value to a variable like following Statement.
(1) b=a;
(2) a=5;
In (1) Example the value of ‘a’ is going into variable ‘b’ in
(2) example 5 is putting in variable ‘a’.
Pointer To A Pointer :-
A variable declared in a Program is assigned an address. A Pointer variable also has an address. Pointer to a Pointer means that a variable can be declared which can store the address of Pointer variable.
//Program to Show the use of ‘Pointer to a Variable’.
#include<iostream.h>
#include<conio.h>
void main ()
clrscr ();
int a=10, *ptr1, **ptr2;
ptr1=&a;
ptr=&ptr1;
cout<<” The value of a variable is:-”<<a<<”in”;
cout<<”The value of a variable by ptr1 is ”<<*ptr<<”/n”;
cout<<”The value of a variable by ptr2 is”<<**ptr2;
getch();
}
I know you will like this post very much.After getting it in your mind please tell me, how it was? Like this post I will provide all stuff like Computer Science , Mathematics , Technology , Meditation etc.
You Also Can See More Result By Using Google Search.
You Also Can Play Online Quiz by following Link,
You Also Can Ask and Give Answer of Questions by following Link,
If you have any requirements to know more about it in detail, then this content may be helpful to you.
You Also Can Visit For More Knowledge In C++:-
Visit Your YouTube Channel:- Think , About It
Visit Your Website :- www.atozlives.com
Thanks,
“Play With All Computer Science , Mathematics And Technology.”
Could you tell me what theme are you utilizing on your web site?
It looks good.
Hi…
How r u ?
Sure,
It is ionmag theme.
thanks for your question.
See you again,
Hallo, ich mochte in Ihrer Firma als freiwilliger arbeiten, konnen Sie mir etwas anbieten?
ein bisschen uber mich:https://about.me/rosa.mann/
Hi,
How r u?
Sure, tell me about your education,address , all other things in detail.
Thanks,
Hello, I want to work in your company on a voluntary basis, can you offer me anything?
a little about me: https://about.me/iren
yhe post c++ ki h jo bhut acha smjaya jya h Nyc
C++ is lite hard but easy for me
Nice article
Thanks for your write-up. One other thing is that if you are selling your property yourself, one of the problems you need to be cognizant of upfront is just how to deal with house inspection reviews. As a FSBO seller, the key concerning successfully transferring your property plus saving money upon real estate agent income is expertise. The more you are aware of, the easier your property sales effort will likely be. One area in which this is particularly essential is assessments.
I like reading through a post that will make people think.
Also, thank you for allowing for me to comment!
Interesting article. It is extremely unfortunate that over the last ten years, the travel industry has already been able to to deal with terrorism, SARS, tsunamis, flu virus, swine flu, and also the first ever true global economic collapse. Through all of it the industry has proven to be robust, resilient and dynamic, getting new strategies to deal with trouble. There are always fresh problems and opportunities to which the industry must all over again adapt and act in response.
Someone essentially help to make seriously posts I would state. This is the first time I frequented your web page and thus far? I amazed with the research you made to make this particular publish extraordinary. Magnificent job!
Thanks on your marvelous posting! I definitely enjoyed reading it, you happen to be a great author.I will make certain to bookmark your blog and will eventually come back at some point. I want to encourage that you continue your great posts, have a nice evening!
Thanks for your helpful post. Through the years, I have come to understand that the particular symptoms of mesothelioma cancer are caused by the build up associated fluid between your lining in the lung and the torso cavity. The sickness may start in the chest spot and distribute to other areas of the body. Other symptoms of pleural mesothelioma cancer include fat loss, severe breathing trouble, fever, difficulty ingesting, and swelling of the face and neck areas. It must be noted that some people living with the disease usually do not experience almost any serious indicators at all.
When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove me from that service? Cheers!
Have you ever considered writing an ebook or guest authoring on other blogs? I have a blog based on the same topics you discuss and would really like to have you share some stories/information. I know my subscribers would value your work. If you’re even remotely interested, feel free to shoot me an e mail.
Have you ever thought about writing an e-book or guest authoring on other sites? I have a blog based upon on the same information you discuss and would really like to have you share some stories/information. I know my readers would appreciate your work. If you’re even remotely interested, feel free to send me an e-mail.
Thanks for discussing your ideas. Another thing is that learners have a selection between federal government student loan and a private student loan where it truly is easier to decide on student loan debt consolidation reduction than over the federal student loan.
A further issue is that video games usually are serious anyway with the key focus on understanding rather than enjoyment. Although, we have an entertainment facet to keep your children engaged, each game is normally designed to work towards a specific expertise or course, such as mathmatical or scientific disciplines. Thanks for your publication.
Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but instead of that, this is great blog. An excellent read. I will certainly be back.
Thanks for another informative web site. Where else could I get that type of info written in such an ideal way? I’ve a project that I’m just now working on, and I have been on the look out for such info.
I think other site proprietors should take this web site as an model, very clean and excellent user friendly style and design, let alone the content. You’re an expert in this topic!
Excellent post. I was checking continuously this blog and I
amm impressed! Extremely useful information. I care for such information a
lot. I was looking ffor this certain information foor a very
long time.Thank you and good luck.
Nice post. I was checking continuously this blog and I am impressed!
Very useful info specially the ultimate part 🙂 I handle such
information much. I used to be seeking this particular information for a very long time.
Thanks and best of luck.
An intriguing discussion is worth comment.
There’s no doubt that that you should write more about
this topic, it may not be a taboo matter but typically folks don’t discuss such topics.
To the next! All the best!!
It’s going to be end of mine day, however before end
I am reading this wonderful post to improve my knowledge.
Hey would you mind sharing which blog platform you’re using?
I’m going to start my own blog in the near future but I’m having a tough time
choosing between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most
blogs and I’m looking for something unique. P.S My apologies for getting off-topic but I had
to ask!
Whats up this is somewhat of off topic but I was wanting
to know if blogs use WYSIWYG editors or if you have to manually
code with HTML. I’m starting a blog soon but have no
coding experience so I wanted to get guidance from someone
with experience. Any help would be greatly appreciated!
Hello, i read your blog from time to time and i own a
similar one and i was just wondering if you get a lot of
spam feedback? If so how do you prevent it, any plugin or
anything you can suggest? I get so much lately it’s driving me crazy so any help is very much appreciated.
I don’t even know how I ended up here, but I thought this post was good.
I don’t know who you are but certainly you are going to
a famous blogger if you aren’t already 😉 Cheers!
Hello, I enjoy reading through your post. I like to write a little comment to support you.
I pay a visit everyday some websites and blogs to read posts, however this webpage presents quality based articles.
Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some time and was hoping maybe
you would have some experience with something like this.
Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new
updates.
I was recommended this web site by my cousin.
I am not sure whether this post is written by him as no
one else know such detailed about my trouble. You’re amazing!
Thanks!
Good day very cool web site!! Man .. Beautiful ..
Amazing .. I will bookmark your blog and take the feeds additionally?
I’m glad to find numerous useful info right here in the publish, we
want develop more techniques in this regard, thank you for sharing.
. . . . .
I have observed that of all forms of insurance, health care insurance is the most marked by controversy because of the conflict between the insurance coverage company’s necessity to remain making money and the buyer’s need to have insurance. Insurance companies’ revenue on wellness plans are extremely low, as a result some businesses struggle to gain profits. Thanks for the strategies you discuss through your blog.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Your article helped me a lot, is there any more related content? Thanks!
Your article helped me a lot, is there any more related content? Thanks!