Thread: bunch of warnings

  1. #1
    Registered User fouzimedfouni's Avatar
    Join Date
    Oct 2014
    Posts
    61

    Exclamation bunch of warnings

    hello guys, how are you,
    I got a small problem with my code, and I would love if somebody can walk me through it step by step and help me debug the code
    here is my code

    Code:
    #include <stdio.h>
    #include <string.h>
     struct books printhello();
     int outputboo( struct books boo);
    struct Books{
       char  title[50];
       char  author[50];
       char  subject[100];
       int   book_id;
    };
    
    
    
    main( ){
    
    
    
    }
    
    outputboo(struct books boo){
        printf(" here is your value of the function of the STRUCT :%i",&boo.book_id );
    }
    
    struct books printhello(){
          struct books boo ;
    
          scanf("%i",&boo.book_id);
          printf("your boo book_id is : %i", boo.book_id);
          return Boo;
    }
    and here is the code in Code::Blocks

    bunch of warnings-untitlecd-jpg

    and here is the warning I got :

    bunch of warnings-untitled-jpg

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    The first thing you need to do is move your function prototypes to after the structure definition. And remember C is case sensitive.

    Next main() should be defined to return an int, and you should return a value from this function.

    Jim

  3. #3
    Registered User fouzimedfouni's Avatar
    Join Date
    Oct 2014
    Posts
    61
    I moved the prototypes after the structure definition and still getting the error (13|warning: parameter has incomplete type)
    and I changed main to :
    Code:
    int main( ){
    
    return 0;
    
    }
    and still the same problem

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    C and C++ are case sensitive.

  5. #5
    Registered User fouzimedfouni's Avatar
    Join Date
    Oct 2014
    Posts
    61
    Quote Originally Posted by whiteflags View Post
    C and C++ are case sensitive.
    which means ?

  6. #6
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Books is different from books.

  7. #7
    Registered User fouzimedfouni's Avatar
    Join Date
    Oct 2014
    Posts
    61
    Quote Originally Posted by whiteflags View Post
    Books is different from books.
    still does not answer my question

  8. #8
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693
    Everything you reference needs to be spelled the Same. Case included
    Code:
    int get_random_number(void)
    {
       return 4; //chosen by fair dice roll.
                 //guaranteed to be random
    }

  9. #9
    Registered User fouzimedfouni's Avatar
    Join Date
    Oct 2014
    Posts
    61
    camel-man - whiteflags ..... thank you guys, I got it now working on the code source more

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Messy bunch o' code
    By Akkernight in forum C++ Programming
    Replies: 38
    Last Post: 01-23-2009, 08:56 AM
  2. Bunch of Bugs
    By ElastoManiac in forum Windows Programming
    Replies: 6
    Last Post: 12-11-2005, 03:49 PM
  3. Umm, how do I tab over a whole bunch of code?
    By funkydude9 in forum C++ Programming
    Replies: 1
    Last Post: 12-23-2002, 11:11 AM
  4. a bunch of little things...
    By dbaryl in forum C Programming
    Replies: 8
    Last Post: 05-15-2002, 08:16 PM