Thread: Errors in Math "tutor"

  1. #16
    Registered User
    Join Date
    Mar 2013
    Posts
    11
    Quote Originally Posted by jimblumberg View Post
    I removed the conio.h include file and getch(). Then I also changed the non-standard scanf_s() to the standard scanf().

    Jim
    I thought scanf_s is better to use than scanf because it is "safe", according to this website. Also, what is the difference of standard, and non standard?

  2. #17
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    if should be something like
    "If you do not want to see error messages like this in the future define DEPRECATED_FUNCTION_CALLS"

    Check the whole output not only error messages. I cannot remember the exact macro name

    UPD: look slike it is _CRT_SECURE_NO_WARNINGS
    Last edited by vart; 07-15-2013 at 11:00 PM.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #18
    Registered User
    Join Date
    Mar 2013
    Posts
    11
    @ varta. it works thank you

  4. #19
    Registered User
    Join Date
    Mar 2013
    Posts
    11
    I have a question related to this, should I start a new thread?

  5. #20
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    I thought scanf_s is better to use than scanf because it is "safe", according to this website.
    That's one of the problems with the WEB. Anyone can publish anything and be considered an expert, and never be idenitified. A WIKI article in my opinion should never be taken as expert advise. Use these articles as stepping stones to find attributed articles so you can research the qualifications of the authors and the relibility of the advice given.

    I suggest you learn to properly use the standard functions, the functions outlined in the ISO C standard. In my opinion the scanf_s() functions are giving you a false sense of security, they can also be misused and cause the same type of problems. Plus I don't see any use of these functions when dealing with anything other than character strings.

    I have a question related to this, should I start a new thread?
    If it's related then this is the place to ask.


    Jim

  6. #21
    Registered User
    Join Date
    Mar 2013
    Posts
    11
    @jim, what it the difference of %lg and %la?. Is it because of the bytes?

  7. #22
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    what it the difference of %lg and %la?. Is it because of the bytes?
    First since you're using the outdated Microsoft compiler I don't recommend you use the "%a" format specifier since that specifier was added in the C99 standard and Microsoft's support for anything other than C90 is severly lacking. But the added 'l' (lower case 'L') signifies a double (long float).

    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 17
    Last Post: 12-15-2006, 11:02 AM
  2. Replies: 5
    Last Post: 06-01-2006, 04:37 PM
  3. Replies: 3
    Last Post: 08-31-2005, 12:41 PM
  4. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 08:25 AM
  5. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 07:59 AM

Tags for this Thread