# Function Problems

Page 1 of 1

## 3 Replies - 559 Views - Last Post: 23 April 2013 - 06:00 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=319338&amp;s=e22dcfcd66e14687b9e5a1c576b060f3&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 haze man

Reputation: 0
• Posts: 11
• Joined: 13-November 12

# Function Problems

Posted 23 April 2013 - 04:51 AM

I am having problem with my functions and wondering if any one can help. What is meant to happen is you select a function from those printed on screen but when you enter the function the function doesnt run. the code below is just a the if statements for the function calls where i think the problem is, any help will be greatful thanks.

```   int choice = 0;
printf("\n \n--------------- Shop Data Base --------------- \n \n");

//printing out options
printf( "Please enter one of the following: \n \n" );
printf( "1. Search \n" );
printf( "2. New Customer \n" );
printf( "3. New Sale \n" );
printf( "4. Convert To Binary \n \n" );

scanf( "%d", &choice );

if ( choice == 1 )
{
printf("You have selected the search function. Please follow the on screen instructions. \n");
void search(void);
flushall();
}
if ( choice == 2 )
{
printf("You have selsted the new customer function. Please follow the on screen instructions. \n");
void customer(void);
flushall();
}
else if ( choice == 3)
{
printf("You have selected the new sale function. Please follow the on screen instructions. \n");
void sale(void);
flushall();
}
else
{

printf("You have selected theconvert files to binary function. Please follow the on screen instructions. \n");
void binary(void);
flushall();
}

getchar();
flushall();
```

Is This A Good Question/Topic? 0

## Replies To: Function Problems

### #2 Zereo

Reputation: 44
• Posts: 108
• Joined: 08-November 12

## Re: Function Problems

Posted 23 April 2013 - 05:14 AM

You are calling your functions wrong.
```void customer(void);
```
Should be called like
```customer();
```
When you call functions you only need to specify the functions name and then pass in arguments if it has parameters

### #3 haze man

Reputation: 0
• Posts: 11
• Joined: 13-November 12

## Re: Function Problems

Posted 23 April 2013 - 05:21 AM

Zereo, on 23 April 2013 - 05:14 AM, said:

You are calling your functions wrong.
```void customer(void);
```
Should be called like
```customer();
```
When you call functions you only need to specify the functions name and then pass in arguments if it has parameters

cool yea saw that, thanks

### #4 Zereo

Reputation: 44
• Posts: 108
• Joined: 08-November 12

## Re: Function Problems

Posted 23 April 2013 - 06:00 AM