473,399 Members | 3,656 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,399 software developers and data experts.

Too many types in declaration in a basic structure program

This is my program
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<string.h>
  4. #include<stdio.h>
  5. #include<math.h>
  6.  
  7.  
  8. struct date
  9. {int dd,mm,yy;}
  10.  
  11. struct emp
  12. {int empno,hra,da,pf,salary,basic;
  13. char name[10];
  14. date d;
  15.  
  16. void in()
  17. {cin>>empno;
  18. gets(name);
  19. cin>>d.dd>>d.mm>>d.yy;}
  20.  
  21. void print()
  22. {cout<<empno<<name<<
  23. "Date of joining"<<d.dd<<d.mm<<d.yy<<
  24. "Salary:Basic,HRA,DA,PF,Netsalary"
  25. <<basic<<hra<<da<<pf<<salary;}
  26.  
  27. void compute()
  28. {hra=0.10*basic;
  29. da=0.15*basic;
  30. pf=0.12*basic;
  31. salary=hra+da+basic-pf  ;} };
  32.  
  33. void main()
  34. {
  35. clrscr();  emp e[10];
  36. char rep='y'; int n;
  37. while(rep=='y')
  38. {cout<<"1.Creating customer \n2.List of employees who earn >30000";
  39. int ch;
  40. cin>>ch;
  41. switch(ch)
  42. {case 1:{cout<<"No of employees";
  43. cin>>n;
  44. for(int i=0;i<n;i++)
  45. {
  46. e[i].in();
  47. e[i].compute();  }}
  48. case 2:{for(int j=0;j<n;j++)
  49. {if(e[j].d.yy>2005&&e[j].salary>30000)
  50. e[j].print();}}
  51. cin>>rep;;}}
  52. getch();
  53. }
  54.  
Error in Line 11:Too many types in declaration
May 18 '14 #1
2 2677
stdq
94 64KB
Hi! Do you mind posting your code using code tags? Also, in which line(s) is(are) the error(s), according to the compiler/linker?
May 18 '14 #2
weaknessforcats
9,208 Expert Mod 8TB
For starters, your struct declarations must be enclosed in braces and end with a semi-colon.

Expand|Select|Wrap|Line Numbers
  1. struct x
  2. {
  3.  
  4. };
May 18 '14 #3

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

Similar topics

1
by: Psymaster | last post by:
How could I do that? I'm writing an image viewer and I would want to associate all images to be opened with my proggie when they are double-clicked.
1
by: Shapper | last post by:
Hello, I have in my project the file mypage.aspx and mypage.aspx.vb I know how to link one to the other but I would like to know what is the basic structure of an aspx.vb file. I just...
8
by: Fabrizio Cyber | last post by:
Hi all, I want to use a .js into a visual basic project. How can I do it ? I've tried to open the script code into my project....and then ??? I see the code but I don't jnow how to make it...
0
by: jkiley | last post by:
I've been working on a page as a project to update my somewhat antiquated web skills. I'm working with XHTML (Strict) and CSS2. My problem is one of organization rather than how to do what I...
9
by: pauldepstein | last post by:
#include <iostream> using namespace std; int main() { int testNum; char *ptr; testNum = 1; ptr = (char*)(&testNum);
3
by: KiranJyothi | last post by:
Hello everybody, While I am doing the program( pasted below ), I am able to see the frame but not the rectangles. Can anyone please help me to get it done. Thanks in...
3
by: Nkhosinathie | last post by:
i've started doing structure today so i'm still not perfect to them.my lecturer has asked me to this program so i really need ur suggestions about it. The following information is available of...
8
by: halo combat22 | last post by:
I am looking on some help on a program where i have the user enter a random number from say 1-20. I do it until number is chosen. Meanwhile it tells the user it it has gotten cooler or warmer from...
9
by: MonkeyHater | last post by:
Hey, I am trying to write a program that allows someone to enter two separate dates and returns the later of the two. I.E. I input 2/14/2004 and 3/2/2004, so it outputs 3/2/2004. This is what I have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.