Thread: Expected expression before char

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    This is how you call the function from another function:

    Code:
    void testFunction(void)
    {
        char bread = 'b';
        char loaf = 'f';
        char manual = 'm';
    
        // code
    
        calc_baking_time(bread,loaf,manual);
    }
    Note that the variable names you feed to the function during the function call do not have to be the same as the variable names in the function declaration/definition.

    Code:
    void testFunction(void)
    {
        char one = 'b';
        char two = 'f';
        char three = 'm';
    
        // code
    
        calc_baking_time(one,two,three);
    }

  2. #2
    Registered User
    Join Date
    Oct 2012
    Posts
    158
    Quote Originally Posted by Matticus View Post
    This is how you call the function from another function:

    Code:
    void testFunction(void)
    {
        char bread = 'b';
        char loaf = 'f';
        char manual = 'm';
    
        // code
    
        calc_baking_time(bread,loaf,manual);
    }
    Note that the variable names you feed to the function during the function call do not have to be the same as the variable names in the function declaration/definition.

    Code:
    void testFunction(void)
    {
        char one = 'b';
        char two = 'f';
        char three = 'm';
    
        // code
    
        calc_baking_time(one,two,three);
    }
    I'm getting very close to being able to run this!
    one last thing. If i cann't use global variables. Must i define char bread_type;
    char loaf;
    and char manual;
    in each function?

    Code:
    void instructions_white_single_manual(char bread_type, char loaf, char manual)
    {
           printf("xoxo");
       calc_bake_time(bread_type, loaf, manual);
    }
    correct format?
    Last edited by tmac619619; 10-23-2012 at 03:51 PM.

  3. #3
    Registered User
    Join Date
    Oct 2012
    Posts
    158
    WOOW MYPROGRAM WORKED

    250+ freaking lines.

    Shout out to Matticus, Andreas, and QNY!!!!!!!!!!!!!!!!1

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. expected expression before ')' token
    By m_programmer in forum C Programming
    Replies: 6
    Last Post: 09-14-2012, 08:02 AM
  2. expected constant expression?
    By GroogFish in forum C Programming
    Replies: 3
    Last Post: 05-08-2012, 12:17 AM
  3. expected primary-expression before ']'
    By ooopa in forum C++ Programming
    Replies: 4
    Last Post: 11-14-2011, 09:35 AM
  4. error: expected an expression
    By cdmstr in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2011, 02:00 PM
  5. expected primary expression
    By mju4t in forum C Programming
    Replies: 2
    Last Post: 03-27-2007, 06:59 PM