473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

"parameter name omitted" error message?

Hi,
I am having problems with this program. I keep on getting the following error messages:


testing.c: In function `next_month':
testing.c:25: error: parameter name omitted
testing.c:27: error: syntax error before "mnth"

My code is:
Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2.  
  3. enum month {jan=0, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec};
  4.  
  5. typedef enum month mnth;
  6.  
  7. mnth next_month(int);
  8.  
  9. int main(void) 
  10. {
  11. int x;
  12. mnth k;
  13.  
  14. printf("Enter. ");
  15. scanf("%d", x);
  16.  
  17. k = (next_month(x));
  18.  
  19. printf("%s", k);
  20.  
  21. return 0;
  22.  
  23.  
  24.  
  25. mnth next_month(int)
  26. return ((mnth) (((int) mnth +1 % 12));
  27. }
  28.  
  29.  
Thanks!
Mar 18 '11 #1

✓ answered by Banfa

line 25 you define an int parameter without naming it (only C++ and C99(?) can have anonymous parameters).

Then at line 27 you treat the type mnth as though it is a variable when you try mnth + 1

2 26409
Banfa
9,065 Expert Mod 8TB
line 25 you define an int parameter without naming it (only C++ and C99(?) can have anonymous parameters).

Then at line 27 you treat the type mnth as though it is a variable when you try mnth + 1
Mar 18 '11 #2
donbock
2,426 Expert 2GB
You are missing the closing bracket for the main function.
Mar 18 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
7
by: ben | last post by:
hello, an algorithm book i'm reading talks about the connectivity problem/algorithm. it gives a number of examples where the connectivity problem applies to real life situations (like, the...
40
by: Dave Hansen | last post by:
Please note crosspost. Often when writing code requiring function pointers, it is necessary to write functions that ignore their formal parameters. For example, a state machine function might...
0
by: Reader | last post by:
On a windows form, there is TableLayoutPane. I 1) Increase size of form 2) Increse size of table 3) Add a row in the table 4) Save I receive exception "Value cannot be null. Parameter name:...
1
by: Godlove Mathew | last post by:
Hi, I installed a Borland C++ in my laptop a 32-bit operating system with windows vista. I wrote i very simple program to display "Hello world" but it gives an error // my first program in C++...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.