error message

This is a discussion on error message within the C++ Programming forums, part of the General Programming Boards category; hey all what does this message mean: passing `int' to argument 1 of `fputs(const char *, FILE *)' lacks a ...

  1. #1
    Registered User deleeuw's Avatar
    Join Date
    Aug 2001
    Posts
    31

    Question error message

    hey all
    what does this message mean:

    passing `int' to argument 1 of `fputs(const char *, FILE *)' lacks a cast

    777

  2. #2
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128

    Smile

    It means that your passing the function an integer argument (of type int) when it expects a pointer to a constant character (a string).


    Code:
    FILE* pFile = fopen("filename.txt","wt");
    // fputs(5,pFile); This will give you the error
    fputs("5",pFile); // This is fine
    Muhammad Haggag

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21