hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2009
Posts: 4
Reputation: che_che has a little shameless behaviour in the past 
Solved Threads: 0
che_che che_che is offline Offline
Newbie Poster

hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
-2
  #1
Jun 30th, 2009
  1. // File Name: ~ftp/pub/class/cplusplus/Structure/StrucSimple.cpp
  2. // Purpose: Demonstrates the use of structure in C++.
  3. // Stores some personal data in a structure, then prints
  4. // the info out.
  5.  
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. // Defining a structure
  12. struct PersonalData
  13. {
  14. char *FirstName;
  15. char *LastName;
  16. char *Birthday; // in the format of 12/30/1978
  17. int PhoneNum;
  18. }; // don't forget the ending ";"
  19.  
  20. // Declaring a variable of type PersonalData
  21. PersonalData PersonOne;
  22.  
  23. // Populate PersonOne with data
  24. PersonOne.FirstName = "John";
  25. PersonOne.LastName = "Doe";
  26. PersonOne.Birthday = "12/30/1978";
  27. PersonOne.PhoneNum = 5855555;
  28.  
  29. // Print the data out
  30. cout << "PersonOne's First name is: " << PersonOne.FirstName << endl;
  31. cout << "PersonOne's Last name is: " << PersonOne.LastName<< endl;
  32. cout << "PersonOne's Birthday is: " << PersonOne.Birthday<< endl;
  33. cout << "PersonOne's Phone number is: " << PersonOne.PhoneNum<< endl;
  34.  
  35. return 0;
  36. }
Last edited by Ancient Dragon; Jun 30th, 2009 at 8:56 am. Reason: add code tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
3
  #2
Jun 30th, 2009
Erm do we look like an online compiler service?
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 672
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 99
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
2
  #3
Jun 30th, 2009
che_che

Check out the programs comments..

// Stores some personal data in a structure, then prints
// the info out.
I guess that's what the output will be.
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 628
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
0
  #4
Jun 30th, 2009
1) put your code in "code" tags
2) compile it yourself and report any errors!
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 117
Reputation: u8sand is on a distinguished road 
Solved Threads: 15
u8sand's Avatar
u8sand u8sand is offline Offline
Junior Poster

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this progr

 
0
  #5
Jun 30th, 2009
The output would be:
  1.  
  2. PersonOne's First name is: John
  3. PersonOne's Last name is: Doe
  4. PersonOne's Birthday is: 12/30/1978
  5. PersonOne's Phone number is: 5855555
Then it will exit right away before you actually see your data unless you run it with command prompt.
Plus i think you might receive an error when assigning a pointer like that :/

But I not know why you need it... First- you can just compile it in your compiler. Second- I think it is pretty self-explanatory...
But just for your satisfaction I posted the output.
Last edited by u8sand; Jun 30th, 2009 at 10:13 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 476
Reputation: csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice csurfer is just really nice 
Solved Threads: 76
csurfer's Avatar
csurfer csurfer is offline Offline
Posting Pro in Training

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
0
  #6
Jun 30th, 2009
Ya we are too good for such small programs...Now do it yourself smart fellow...!!!
I Surf in "C"....
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 255
Reputation: Hiroshe is a jewel in the rough Hiroshe is a jewel in the rough Hiroshe is a jewel in the rough Hiroshe is a jewel in the rough 
Solved Threads: 16
Hiroshe's Avatar
Hiroshe Hiroshe is offline Offline
Posting Whiz in Training

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
0
  #7
Jun 30th, 2009
Here we help people learn and understand programming. We don't answer questions without the questioneer doing work to understand what the problem is and attempting to fix it... Judging from the filename I'd say this is homework and you have no idea what your doing. Unless, of course, your "just testing us"

If you don't know how to program/ program in c++, and your in a computer science class, use google to lean how to program. "how to program in c++" should do it. Good luck.
"Sometimes, when I lie in bed at night and look up at the stars, I think to myself, "Man! I really need to fix that roof."-Jack Handy
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 4
Reputation: che_che has a little shameless behaviour in the past 
Solved Threads: 0
che_che che_che is offline Offline
Newbie Poster

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
0
  #8
Jun 30th, 2009
really i have problems compiling?? on google i dont really understand..
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 255
Reputation: Hiroshe is a jewel in the rough Hiroshe is a jewel in the rough Hiroshe is a jewel in the rough Hiroshe is a jewel in the rough 
Solved Threads: 16
Hiroshe's Avatar
Hiroshe Hiroshe is offline Offline
Posting Whiz in Training

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
1
  #9
Jun 30th, 2009
Originally Posted by che_che View Post
really i have problems compiling?? on google i dont really understand..
You have no idea what you are doing, do you? Let me introduce you to programming. You write code in something called a computer language. A computer language is a mathamatical and logical language to tell the computer what to to. The computer itself can't understand the language, you need a compiler (which is a program) to translate it into machine code (binary instructions). The program in your post is written in a language called C++, so you need a C++ compiler to turn it into a program. This webpage will show you how to install the compiler. Click here to learn C++, the language your program was written in.

Why is someone, who has no idea what programming is, trying to know what the output of a C++ code segment is anyway??
Last edited by Hiroshe; Jun 30th, 2009 at 10:04 pm.
"Sometimes, when I lie in bed at night and look up at the stars, I think to myself, "Man! I really need to fix that roof."-Jack Handy
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 4
Reputation: che_che has a little shameless behaviour in the past 
Solved Threads: 0
che_che che_che is offline Offline
Newbie Poster

Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..

 
0
  #10
Jul 1st, 2009
sorry though its my first in c++,,,

they say its more simple than java,,

sorry guys... hiroshe i wont ask for answers but can u help me..

i reli want 2 know c++
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC