error: called object is not a function

This is a discussion on error: called object is not a function within the C Programming forums, part of the General Programming Boards category; I have a function which is giving me an error: error: called object is not a function The function which ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    24

    error: called object is not a function

    I have a function which is giving me an error:

    error: called object is not a function

    The function which the error is relating to is this one:

    Code:
    int show_recent( char* checkvalue )
    {
    	if ((strncmp(checkvalue, "recent", 1) == 0)||(strncmp(checkvalue, "RECENT", 1) == 0)(strncmp(checkvalue, "Recent", 1) == 0))
    	{
    		printf("\n%s", recent_guess1);
    		pirntf("%s", recent_guess2);
    		printf("%s", recent_guess3);
    		printf("%s", recent_guess4);
    		recent = 1;
    	}else{
    	recent = 0;
    	}
    }
    Does anyone have any ideas what could be causing this???

    Thanks

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Code:
       if ( (strncmp(checkvalue, "recent", 1) == 0) ||
            (strncmp(checkvalue, "RECENT", 1) == 0) ||
            (strncmp(checkvalue, "Recent", 1) == 0) )
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    36
    Hi,

    I modified the code a bit and tried to compile. There is no error.

    Code:
    #include <stdio.h>
    #include <string.h>
    
    int show_recent( char* checkvalue )
    {
            int recent;
            if ((strncmp(checkvalue, "recent", 1) == 0)||(strncmp(checkvalue, "RECENT", 1) == 0)||(strncmp(checkvalue, "Recent", 1) == 0))
            {
    //              printf("\n&#37;s", recent_guess1);
    //              pirntf("%s", recent_guess2);
    //              printf("%s", recent_guess3);
    //              printf("%s", recent_guess4);
                    recent = 1;
            }else{
            recent = 0;
            }
    }
    linux:~/prog # gcc -c recent.c
    linux:~/prog #

    Regards,

    Arun

  4. #4
    Registered User
    Join Date
    Mar 2008
    Location
    Sant Feliu de Codines - Barcelona - Catalunya
    Posts
    2

    printf bad write

    Hi,

    the second "printf" is bad write, you say "pirntf".

    see you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Passing A Function From One Object to Another
    By HalNineThousand in forum C++ Programming
    Replies: 8
    Last Post: 03-28-2008, 07:26 PM
  4. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  5. Function doesn't return an object
    By Aiwendil in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2004, 03:15 PM

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