Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
C++
#include <iostream.h>
#include <conio.h>
void main()
{
     clrscr();
     char c = 'a';
     int i=10;
     double d=15;
     int * iptr = &i;
     char * cptr = &c;
     double * dptr = &d;

     cout << "The address of integer value is " << iptr << endl;
     cout << "the address of character value is "<< cptr << endl;
     cout << dptr << endl;
     cout << sizeof(i); << endl;
     cout << sizeof(d); <<endl;
     cout << sizeof(c); <<endl;
     cout << sizeof(cptr); << endl;
     cout << sizeof(iptr); << endl;
     cout << sizeof(dptr); << endl;
     getch();
}


What I have tried:

I have tried searching for the solution on Google and could not find it
Posted
Updated 15-Apr-21 9:43am
v3
Comments
Chris Maunder 15-Apr-21 15:06pm    
Your code was a bit messed up. I've tried my best at guessing what it should be so please either come and correct it or close the question if you've moved on and no longer need help. Have you actually tried compiling this with a C compiler? If so, what errors did you get? (if any)

Why are you even involved in computer programming?   If your life revolves around looking up other peoples answers on Google, or asking for people in forums to do your work for you then you really should think about how you want to spend your life.

Sooner is better than later - either you want to do coding (or anything else) and will do the work required to learn it or you'll need to figure out how support yourself when you are not good at anything.



 
Share this answer
 
Comments
Chris Maunder 15-Apr-21 15:10pm    
a) How is berating someone helpful?
b) If you feel the need to be negative then make it a comment, not an answer, please. Or simply just vote it down and move on.
W Balboos, GHB 15-Apr-21 15:13pm    
I was going to add, and maybe should have, that this might be some of the kindest advice he gets. I understand you took it as a berating but it's also a wake-up call. I didn't call him stupid or anything like that. It may be someone who is on the wrong life course - possibly pushed into it by parents or friends.

I'll try to soften it, but shouldn't there be some way of telling the poster that maybe they're in the wrong field?
[no name] 15-Apr-21 15:54pm    
15 year member who does not know how to response to a comment ...
Of course there is no solution on google because every piece of code is different.

No one here will do your homework for you; however, we are happy to help.

So, get started on it and do what you can. If you cannot do any of it then my guess is you have not been paying attention in class.

When you get stuck on something specific please come back and ask a specific question and we'll gladly help.
 
Share this answer
 
There's nothing to convert.

The only thing that needs to change is the cout statements have to be replaced by their C equivalents.

I'm not telling you how to do it because I suspect you got a homework assignment and you're using someone else's code, trying to turn it in as your own work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900