| | |
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
![]() |
•
•
Join Date: Jun 2009
Posts: 4
Reputation:
Solved Threads: 0
hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
-2
#1 Jun 30th, 2009
C++ Syntax (Toggle Plain Text)
// File Name: ~ftp/pub/class/cplusplus/Structure/StrucSimple.cpp // Purpose: Demonstrates the use of structure in C++. // Stores some personal data in a structure, then prints // the info out. #include <iostream> using namespace std; int main() { // Defining a structure struct PersonalData { char *FirstName; char *LastName; char *Birthday; // in the format of 12/30/1978 int PhoneNum; }; // don't forget the ending ";" // Declaring a variable of type PersonalData PersonalData PersonOne; // Populate PersonOne with data PersonOne.FirstName = "John"; PersonOne.LastName = "Doe"; PersonOne.Birthday = "12/30/1978"; PersonOne.PhoneNum = 5855555; // Print the data out cout << "PersonOne's First name is: " << PersonOne.FirstName << endl; cout << "PersonOne's Last name is: " << PersonOne.LastName<< endl; cout << "PersonOne's Birthday is: " << PersonOne.Birthday<< endl; cout << "PersonOne's Phone number is: " << PersonOne.PhoneNum<< endl; return 0; }
Last edited by Ancient Dragon; Jun 30th, 2009 at 8:56 am. Reason: add code tags
Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
3
#2 Jun 30th, 2009
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..
I guess that's what the output will be.
Check out the programs comments..
•
•
•
•
// Stores some personal data in a structure, then prints
// the info out.
•
•
Join Date: Feb 2008
Posts: 628
Reputation:
Solved Threads: 46
Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
0
#4 Jun 30th, 2009
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:
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.
C++ Syntax (Toggle Plain Text)
PersonOne's First name is: John PersonOne's Last name is: Doe PersonOne's Birthday is: 12/30/1978 PersonOne's Phone number is: 5855555
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.
Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
0
#6 Jun 30th, 2009
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.
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
•
•
Join Date: Jun 2009
Posts: 4
Reputation:
Solved Threads: 0
Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
0
#8 Jun 30th, 2009
Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
1
#9 Jun 30th, 2009
•
•
•
•
really i have problems compiling?? on google i dont really understand..
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
•
•
Join Date: Jun 2009
Posts: 4
Reputation:
Solved Threads: 0
Re: hey guys.. ur go0d at programing right.. ima ask u whats the output of this program..
0
#10 Jul 1st, 2009
![]() |
Similar Threads
- Getting arrays and changing them. (C++)
- Hey guys (Community Introductions)
- hey guys!! can you help me with this?? (Java)
- hey guys plz help me!!!!!! (IT Professionals' Lounge)
- Make the program stop (C++)
- Hey Guys, CMS needed ..... (Existing Scripts)
- Including other python programs (Python)
- checking for a space bar input (C++)
Other Threads in the C++ Forum
- Previous Thread: Help with streams
- Next Thread: The Hello World server/client program
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






