String manipulation.

This is a discussion on String manipulation. within the C++ Programming forums, part of the General Programming Boards category; >> Isn't there a function for converting a single char to an int? No. There really isn't any need for ...

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    >> Isn't there a function for converting a single char to an int?
    No. There really isn't any need for it anyway, since writing it out is so simple and always works.

    >> Or couldn't i just cast the char to an int? Would that help?
    No, casting to an int would provide the character code for the digit, not the actual number itself. An implicit cast is what was done automatically in your original code that was causing the problem.
    Last edited by Daved; 06-15-2007 at 09:57 AM.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  2. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  3. Replies: 4
    Last Post: 03-03-2006, 01:11 AM
  4. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 09:33 PM
  5. string manipulation
    By SPEKTRUM in forum Linux Programming
    Replies: 3
    Last Post: 01-26-2002, 10:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21