Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coding help with data types etc.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
In C++ i am writing a program that accepts and angle in degrees, minutes and seconds in the format (x y z), having a space inbetween each of the values. I know that an integer is for numbers and double for more complex numbers. What is the data typ needed for this or am i looking in the wrong area and there is some other way to do it?

thanks heaps if you can help me :)
 
Assuming that i understand your question correctly. Maybe u can use a string or char array to accept the input then chop up the array in a way that u deem fit.
 
Yes, you could use a string...but you can also use the "int" type or "long" type since Degrees, minutes, and seconds are just pretty much numbers anyway. Since you will be doing math with them, it would be easier to have them as numbers instead of a string....if I understand you correctly.

Niky Williams
Lead Engineer
NTS Marketing, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top