Integer digits

This is a discussion on Integer digits within the C++ Programming forums, part of the General Programming Boards category; Hey guys. This is probably really simple, but I can't figure it out. All that I wish to do is ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    183

    Question Integer digits

    Hey guys.

    This is probably really simple, but I can't figure it out.
    All that I wish to do is take an int, and store the number
    of digits in that int in another int.

    Is there a function to do this?
    If so, any examples would be great
    if you can be bothered.

    Cheers for any useful info

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    Count how many times you can divide it by 10.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    183
    Oh right yeah, so simple.
    Cheers Salem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory issue
    By t014y in forum C Programming
    Replies: 2
    Last Post: 02-20-2009, 11:37 PM
  2. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 05:55 PM
  3. Assignment HELP!!
    By cprogrammer22 in forum C Programming
    Replies: 35
    Last Post: 01-24-2009, 01:24 PM
  4. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 09:42 AM
  5. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM

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