| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
C++ identify emty space? & set/get statements help
Does anyone here know a code that can be used to identify an empty space in a variable?
This is what the proggram is supposed to be: 1) Ask the user his name and last name and save it in one variable 2) use code to separate that variable into two different variables by identifiying an empty space between the name and last name or a coma 3) Display the two new variables I can do it the other way around (saving the name and lastname into two variables then copying them to one) Quetion number two: can anyone give me a link to a good and easy Set and Get statement tutorial? Google isn't very helpful in this... All help is very appreciated ^_^ Thank you |
|
#2
|
|||
|
|||
|
Do a search for string tokenizers for the first part of this but be *VERY* careful if you use the one from the C standard libraries since its pretty much broken beyond all belief. Alternatively write a loop to go through the string character by character and test each one against ' ' and ','.
To learn about set/get methods do a google search for accessor methods and you're likely to turn up more useful results. Hope this helps, -KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > C++ identify emty space? & set/get statements help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|