Thread: To add on to my Stupid Question

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    34

    To add on to my Stupid Question

    Ok here is what I am doing. I am comparing 6 numbers for which number has the most digits. For some reason my loop goes through and counts my smallest number.

    Here is my code:

    for ( int x = 0; x < z; x++ )
    {
    number = num1[x];
    e = d;
    digitCnt = 0;
    while(number)
    {
    number=number/10;
    digitCnt++;
    }
    d = digitCnt;
    if ( e > d )
    f = d;
    }

    What am I doing wrong?

    The Ski
    http://members.ebay.com/aboutme/the_ski/

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    34
    Disregard this post as well.

    The Ski
    http://members.ebay.com/aboutme/the_ski/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-04-2005, 12:17 AM
  2. Probably A Stupid Question
    By samGwilliam in forum C++ Programming
    Replies: 27
    Last Post: 07-10-2005, 01:06 PM
  3. Stupid Question
    By digdug4life in forum C++ Programming
    Replies: 22
    Last Post: 05-17-2005, 11:43 AM
  4. stupid, stupid question
    By xelitex in forum C++ Programming
    Replies: 5
    Last Post: 12-22-2004, 08:22 PM
  5. Stupid question: What does Debugger do?
    By napkin111 in forum C++ Programming
    Replies: 6
    Last Post: 05-02-2002, 10:00 PM