Results 1 to 5 of 5

Thread: C++ quick question

  1. #1
    Senior Member
    Join Date
    Jun 2004
    Posts
    379

    C++ quick question

    Hey guys just wondering is there a way to find the length of a int var in c++ like string.length() for strings?

  2. #2
    Senior Member t34b4g5's Avatar
    Join Date
    Sep 2003
    Location
    Australia.
    Posts
    2,391
    Greetz Riot.

    haven't properly checked but hopefully i've dug up a fairly useful url for you to take a gander at.

    http://oopweb.com/CPP/Documents/Thin...ume/chap07.htm

  3. #3
    Senior Member
    Join Date
    Jun 2004
    Posts
    379
    definitely a good link but not exactly what i was looking for what i mean was if i have something like:

    int numbers;
    cout << " Enter some number: ";
    cin >> number;

    I want to find out how many characters are being held in the var numbers.

  4. #4
    Junior Member BabyNet's Avatar
    Join Date
    Oct 2003
    Location
    Underground base in the mountains.
    Posts
    18
    This thread is a month old. But better late than never.

    Ok. I found this site interesting. It might help with your question. Here is the link:

    http://linuxshellaccount.blogspot.co...acters-in.html

    Good luck.
    Salmos 23:4 Aunque ande en el valle de sombra profunda, no temo nada malo, porque tu estas conmigo; tu vara y cayado son las cosas que me consuelan.

  5. #5
    Quote Originally Posted by Riot View Post
    Hey guys just wondering is there a way to find the length of a int var in c++ like string.length() for strings?
    Pay me!

    gcount Get number of characters extracted by last unformatted input operation (public member function)
    You should study up on c and C++. Hope you were not talking about sizeof(int). Well here's a link that may help solve your vague question.

    http://www.cplusplus.com/reference/iostream/iostream/

    BTW, possible buffer overflow! Think about it.
    Last edited by Linen0ise; December 26th, 2009 at 06:10 AM.

Similar Threads

  1. Quick question, linux programming
    By TheRepublican in forum General Programming Questions
    Replies: 4
    Last Post: April 23rd, 2005, 05:57 PM
  2. Quick Apache Question...
    By NetSec in forum *nix Security Discussions
    Replies: 2
    Last Post: September 25th, 2002, 01:02 AM
  3. Quick question: Can a group be added to a group?
    By roswell1329 in forum *nix Security Discussions
    Replies: 2
    Last Post: September 13th, 2002, 10:18 PM
  4. quick question
    By Obliterate in forum Newbie Security Questions
    Replies: 16
    Last Post: August 26th, 2002, 10:44 AM
  5. quick linux question
    By lewzer in forum Newbie Security Questions
    Replies: 3
    Last Post: August 7th, 2002, 03:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •