Thread: A question about using "fscanf_s" to read data in the txt file.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    i've lost my mind
    Join Date
    Jun 2008
    Posts
    26
    . you could use a 64bit int <-- best bet for ya

    if you scaled this...

    . without having to use a large number lib, you could check input and see if it is equal to the max value of int/long/etc and throw an error; "value may* exceed ..."

    . you could use a large number lib and just do a comparison, if a > b. throw error based on that.

    . you could count the number of integers for the input by reading it in as const char * ("%s" format), and starting with the most significant integer checking each value to see if it ever 'exceeds' using 'atoi()'. throw error based on that.
    Last edited by gltiich; 06-16-2008 at 11:20 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. read data from file
    By matth in forum C++ Programming
    Replies: 3
    Last Post: 04-21-2005, 09:37 AM
  2. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. data read problem
    By Supra in forum C Programming
    Replies: 0
    Last Post: 02-03-2002, 07:02 PM