Thread: What does this compiler message mean?

  1. #1
    Registered User mc088's Avatar
    Join Date
    Jan 2017
    Posts
    19

    What does this compiler message mean?

    Hi,

    I am currently using Microsoft Visual Studio community 2017.

    Was writing simple C program to calculate taxes. hours worked, and such, and when I compiled the program, the output window showed:

    Code:
    1>d:\documents\visual studio 2017\projects\c\program7.c(54): note: placeholders and their parameters expect 0 variadic arguments, but 1 were provided
    Would appreciate if anybody can explain to me what this note means, as googling didn't seem to be getting me anywhere. The note issue doesn't affect my program, but just want to know what it means and if there's a fix to take care of that message.

    Seen this note appear twice for a simple printf line of the following:

    Code:
    printf("Gross pay = $0.2f\n", gross_pay);

    Thanks!
    Last edited by mc088; 04-22-2017 at 12:54 PM.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,608
    You have provided a variable but it seems you failed to provide a format specifier for that variable, you forgot the '%'.


    Jim

  3. #3
    Registered User
    Join Date
    Apr 2017
    Posts
    80
    You need a percent based formatter: A printf format reference page (cheat sheet) | alvinalexander.com

    So

    Code:
    printf("Gross pay = $%0.2f\n", gross_pay);


    will probably do it.

  4. #4
    Registered User mc088's Avatar
    Join Date
    Jan 2017
    Posts
    19
    Ok Thank you. I did forget the % sign for the printf. Problem solved

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Error Message
    By Andrew Gaupp in forum C++ Programming
    Replies: 2
    Last Post: 01-02-2015, 07:46 PM
  2. Compiler Error Message
    By explosive in forum C++ Programming
    Replies: 6
    Last Post: 11-04-2004, 06:35 AM
  3. compiler warning message
    By alice in forum C Programming
    Replies: 2
    Last Post: 04-18-2004, 12:53 PM
  4. DEV-C++ compiler message/
    By tu_user in forum C++ Programming
    Replies: 11
    Last Post: 01-18-2004, 01:56 AM
  5. Can't figure out compiler message please help
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 03-27-2002, 10:22 AM

Tags for this Thread