Problems with character strings

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

Join Date: Dec 2004
Posts: 1
Reputation: Caesar Were is an unknown quantity at this point 
Solved Threads: 0
Caesar Were Caesar Were is offline Offline
Newbie Poster

Problems with character strings

 
0
  #1
Dec 28th, 2004
Well hallo comrades, just been having problems with character strings. Wrote a program that requires typing in of information yet it wasn't possible to represent the character strings in a comfortable manner for whoever is to use the program. Also is there a possible way to make the inputing of a password be in a format not seen by another during input e.g. ******* characters during input. Still polishin on proceedural programming C++. Sent a program with its executable part as an attachment. Just a simple one, any opinions on how to make a more realistic and useful program? Phone number to begin the program is 720797278. Gud day!
Attached Files
File Type: cpp SELF EVALUATION PROGRAM VERSION 3!.CPP (10.9 KB, 7 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 445
Reputation: 1o0oBhP is an unknown quantity at this point 
Solved Threads: 6
1o0oBhP's Avatar
1o0oBhP 1o0oBhP is offline Offline
Posting Pro in Training

Re: Problems with character strings

 
0
  #2
Dec 28th, 2004
Hi there I took a look at the code and yes there is a MUCH better way to get it to be user friendly. Have you thought about the use of the ANSI c++ string class (#include <cstring>)? I believe there is a code snippet showing some functions on the c/c++ snippets forum. If not try http://www.msoe.edu/eecs/ce/courseinfo/stl/string.htm as a guide. This will allow your users to input text and allows you to analyze their input! if you want options/multi-choice questions then I would stick with numbering the responses. Hope this helps
http://sales.carina-e.com

no www
no nonsense

coming soon to a pc near you! :cool:
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 445
Reputation: 1o0oBhP is an unknown quantity at this point 
Solved Threads: 6
1o0oBhP's Avatar
1o0oBhP 1o0oBhP is offline Offline
Posting Pro in Training

Re: Problems with character strings

 
0
  #3
Dec 28th, 2004
i had another look and realised its pretty much multiple choice so the string class may not be that simpler. however use of a switch statement would clean up the code a bit

  1. switch (variable)
  2. {
  3. case value1:
  4. {
  5. // process code if variable == value1
  6. }
  7. break;
  8. case value2:
  9. {
  10. // process code if variable == value 2
  11. }
  12. default:
  13. {
  14. // no matches, process code if variable did equal any of the cases
  15. }
  16. break;
  17. };

again a google seach for the switch statement should proove useful.
http://sales.carina-e.com

no www
no nonsense

coming soon to a pc near you! :cool:
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC