| | |
Declaration Syntax Error on line 155. Please help need urgent .
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 16
Reputation:
Solved Threads: 0
Now im getting Declaration Syntax Error on line 155. Please help need urgent .
C++ Syntax (Toggle Plain Text)
#include <stdio.h> #include <conio.h> #include<process.h> #include<dos.h> void graph(); void foo(){ int a,b; clrscr(); gotoxy(27,12);textcolor(12);cprintf(" "); gotoxy(40,14);textcolor(12);cprintf(" "); gotoxy(29,16);textcolor(12);cprintf(" "); for(a=1;a<=72;a++){ gotoxy(5+a,2);printf("Í"); gotoxy(5+a,23);printf("Í"); } for(b=1;b<=20;b++){ gotoxy(5,2+b);printf("º"); gotoxy(78,2+b);printf("º"); } for(int s=1; s<=3;s++){ gotoxy(41,2+s);printf("º"); } for(int o=1;o<=72;o++){ gotoxy(5+o,5);printf("Í"); } gotoxy(5,2);printf("É"); gotoxy(78,2);printf("»"); gotoxy(5,23);printf("È"); gotoxy(78,23);printf("¼"); gotoxy(41,2);printf("Ë"); gotoxy(5,5);printf("Ì"); gotoxy(78,5);printf("¹"); gotoxy(41,5);printf("Ê"); getche(); getche(); graph(); } void graph() { clrscr(); int choice; char z,m; gotoxy (12,12);textcolor(4+BLINK); cprintf("LOADING:"); for(m=1;m<=50;m++){ gotoxy(19+m,12);textcolor(RED);cprintf("²"); }for (z=1;z<=50;z++){ gotoxy(19+z,12);textcolor(GREEN);cprintf("Û"); delay(40); }clrscr(); gotoxy(27,3);textcolor(12);cprintf(" "); gotoxy(40,4);textcolor(12);cprintf(" "); gotoxy(29,5);textcolor(12);cprintf(" "); for(int g=1;g<=72;g++){ gotoxy(5+g,2);printf("Í"); gotoxy(5+g,23);printf("Í"); } for(int v=1;v<=20;v++){ gotoxy(5,2+v);printf("ߺ"); gotoxy(78,2+v);printf("ºß"); } for(int k=1; k<=3;k++){ gotoxy(41,2+k);printf(""); } for(int p=1;p<=72;p++){ gotoxy(5+p,6);printf("Í"); } gotoxy(5,2);textcolor(GREEN);cprintf(" É"); gotoxy(78,2);textcolor(GREEN);cprintf("» "); gotoxy(5,23);textcolor(GREEN);cprintf("ßÈ"); gotoxy(78,23);textcolor(GREEN);cprintf("¼ß"); gotoxy(41,2);textcolor(GREEN);cprintf("Í"); gotoxy(5,6);textcolor(GREEN);cprintf("ßÌ"); gotoxy(78,6);textcolor(GREEN);cprintf("¹ß"); gotoxy(41,6);textcolor(GREEN);cprintf("Í"); for(int l=1;l<=50;l++){ gotoxy(17+l,7);textcolor(YELLOW);cprintf("ß"); gotoxy(17+l,20);textcolor(YELLOW);cprintf("Ü"); } for(int n=1;n<=14;n++) { gotoxy(18,6+n);textcolor(YELLOW);cprintf("Þ"); gotoxy(67,6+n);textcolor(YELLOW);cprintf("Ý"); } gotoxy(37,7);textcolor(9);cprintf(" M E N U "); gotoxy(30,9);textcolor(6);cprintf("[1] EVEN/ODD IDENTIFIER"); gotoxy(30,11);textcolor(6);cprintf("[2] 1000x NAME MULTIPLIER"); gotoxy(30,13);textcolor(6);cprintf("[3] MULTIPLICATION TABLE"); gotoxy(30,15);textcolor(6);cprintf("[4] TRIANGLE AREA CALCULATOR"); gotoxy(30,17);textcolor(6);cprintf("[5] P A Y R O L L"); gotoxy(29,19);textcolor(6);cprintf(" [6] E X I T "); gotoxy(24,22);textcolor(4);cprintf("ENTER CHOICE:"); scanf("%d",&choice); switch(choice) { case 1:int dog; clrscr(); printf("Enter number:"); scanf("%d",&dog); if(dog%2==0) { printf("EVEN \n"); } else { printf("ODD \n"); } getche();graph(); break; case 2: clrscr(); int e,r,t; char name[15]; printf("Enter your name:"); scanf("%s",&name); gotoxy (12,12);textcolor(GREEN+BLINK); cprintf("LOADING:"); for(t=1;t<=50;t++){ gotoxy(19+t,12);textcolor(RED);cprintf("²"); }for (r=1;r<=50;r++){ gotoxy(19+z,12);textcolor(BLUE);cprintf("Û"); delay(40); }clrscr(); for(e=1; e<=1000; e++){ printf("%s \t",name); } getche();graph(); break; case 3: clrscr(); for(int a1=1;a1<=9;a1++) { for(int a2=1;a2<=9;a2++) { printf("\t"); printf("%d",a1*a2); } printf("\n"); } getche();graph(); break; case 4: int a,b; clrscr(); printf("Enter base and height:"); scanf("%d%d",&a,&b); printf("Area is %d.",(a*b)/2); getche();graph(); break; case 5: float rate,day,gp,netpay,totald,sss,med,love;int age; float basic,cola,tax;char employee[20],addr[30],sex[10],bday[8]; int main(){ clrscr(); char choice; gotoxy(20,2);textcolor(4);cprintf("Payroll System"); gotoxy(20,4);textcolor(5);cprintf("Select Choices:"); gotoxy(18,6);textcolor(7);cprintf("[1] Add Customer Info"); gotoxy(18,7);textcolor(7);cprintf("[2] Compute Payroll"); gotoxy(18,8);textcolor(7);cprintf("[3] Display Information"); gotoxy(18,9);textcolor(7);cprintf("[4] Exit"); gotoxy(18,10);textcolor(7);cprintf("Enter Choice:"); scanf("%d",&choice); switch (choice){ case 1:printf("Employee Information\n\n"); printf("Enter Employee name:"); scanf("%s",&employee); printf("Enter address:"); scanf("%s",&addr); printf("Enter sex:"); scanf("%s",&sex); printf("Enter age:"); scanf("%d",&age); printf("Enter bday:"); scanf("%s",&bday);main(); case 2:printf("Payroll Input\n:"); printf("Enter rate:"); scanf("%f",&rate); printf("Enter day:"); scanf("%f",&day); basic=rate*day; cola=basic*.02; gp=basic+cola; sss=gp*.073; med=gp*.081; love=gp*.092; if(gp>=2500){ tax=gp*.12;}else { printf("No tax");} totald=sss+med+love+tax; netpay=gp-totald;main(); case 3:printf("Employee Information\n"); printf("Employee name is %s\n",employee); printf("Employee address %s\n",addr); printf("Employee gender%c\n",sex); printf("Employee age %d\n",age); printf("Employee bday%s\n",bday); printf("\n"); printf("payroll Information\n"); printf("Rate per day%.2f\n",rate); printf("Number of day%.2f\n",day); printf("Basic%.2f\n",basic); printf("Cola %.2f\n",cola); printf("Grosspay%.2f\n",gp); printf("Tax is%.2f\n",tax); printf("Total deduction %.2f\n",totald); printf("netpay%.2f\n",netpay);getche();main(); case 4: exit(0); default:printf("Invalid input");getche();main(); } getche();graph(); break; } case 6: exit(0);break; default:printf("Invalid Entry"); } getche();}
•
•
Join Date: Jul 2008
Posts: 16
Reputation:
Solved Threads: 0
And sorry but IM ******** New to C++. And its compiler btw is Turbo C++. Its ancient. Thank you. Please stick to the topic. Im new to C++ and knows nothing.
•
•
•
•
And sorry but IM ******** New to C++. And its compiler btw is Turbo C++. Its ancient. Thank you. Please stick to the topic. Im new to C++ and knows nothing.
Narue gave you some great advice. If you indent your code, you will probably see a mismatch in brackets or something.
If you already know that TC++ is ancient, why are you still using it?
•
•
Join Date: Jul 2008
Posts: 16
Reputation:
Solved Threads: 0
Im not bashing him. He started. Im just here asking not to be insulted.
Why I am using that compiler? Because it is our assignment and we cannot use advanced code that we did not yet tackle. Basic first that is what our teacher said . and again IM noob so sorry for the coding. (T T)
Why I am using that compiler? Because it is our assignment and we cannot use advanced code that we did not yet tackle. Basic first that is what our teacher said . and again IM noob so sorry for the coding. (T T)
Last edited by networkmancer; Sep 7th, 2009 at 10:59 am.
In the words of crunchie: "Eat some snickers. "
The problem is that you're learning all sorts of non-standard commands that you need to unlearn later. If your teacher makes you use Turbo, (s)he needs to be fired.
Visual Studio 2008 and Code::blocks are very good (free) alternatives for Turbo. C++ will non get 'more advanced' by using a compiler that lives up to the C++-standard. C++ is C++, that's why a standard was made.
•
•
•
•
Why I am using that compiler? Because it is our assignment and we cannot use advanced code that we did not yet tackle. Basic first that is what our teacher said .
Visual Studio 2008 and Code::blocks are very good (free) alternatives for Turbo. C++ will non get 'more advanced' by using a compiler that lives up to the C++-standard. C++ is C++, that's why a standard was made.
Last edited by niek_e; Sep 7th, 2009 at 11:07 am.
>Please stick to the topic.
I never went off topic. You have a brace mismatch, and the reason you have it is because your formatting is atrocious. Fix the formatting and you will see the problem.
Im new to C++ and knows nothing.
Clearly. But you know enough to write that mess, so you should know enough to format it like the books or tutorials you're following to learn C++. We don't format our code just to make it look pretty, we format it to make errors stand out. This is a lesson you need to learn, as early as possible, and I'm not afraid to beat it into you.
Im not bashing him. He started.
Your first mistake is thinking that I was bashing you. You're not important enough for me to bother. Just another noob who gets all insulted and defensive when I tell him that his code sucks. I haven't even gotten into the other problems with your code, and I probably won't if each issue is going to be a battle against your frail little ego.
Im just here asking not to be insulted.
Sorry dude, but bad code is bad code. If you're insulted by me pointing out your bad code, you have insecurity issues that need to be addressed.
I never went off topic. You have a brace mismatch, and the reason you have it is because your formatting is atrocious. Fix the formatting and you will see the problem.
Im new to C++ and knows nothing.
Clearly. But you know enough to write that mess, so you should know enough to format it like the books or tutorials you're following to learn C++. We don't format our code just to make it look pretty, we format it to make errors stand out. This is a lesson you need to learn, as early as possible, and I'm not afraid to beat it into you.
Im not bashing him. He started.
Your first mistake is thinking that I was bashing you. You're not important enough for me to bother. Just another noob who gets all insulted and defensive when I tell him that his code sucks. I haven't even gotten into the other problems with your code, and I probably won't if each issue is going to be a battle against your frail little ego.
Im just here asking not to be insulted.
Sorry dude, but bad code is bad code. If you're insulted by me pointing out your bad code, you have insecurity issues that need to be addressed.
Last edited by Narue; Sep 7th, 2009 at 11:11 am.
New members chased away this month: 4
•
•
Join Date: Jul 2008
Posts: 16
Reputation:
Solved Threads: 0
•
•
•
•
In the words of crunchie: "Eat some snickers. "
The problem is that you're learning all sorts of non-standard commands that you need to unlearn later. If your teacher makes you use Turbo, (s)he needs to be fired.
Visual Studio 2008 and Code::blocks are very good (free) alternatives for Turbo. C++ will non get 'more advanced' by using a compiler that lives up to the C++-standard. C++ is C++, that's why a standard was made.
•
•
•
•
>Please stick to the topic.
I never went off topic. You have a brace mismatch, and the reason you have it is because your formatting is atrocious. Fix the formatting and you will see the problem.
Im new to C++ and knows nothing.
Clearly. But you know enough to write that mess, so you should know enough to format it like the books or tutorials you're following to learn C++. We don't format our code just to make it look pretty, we format it to make errors stand out. This is a lesson you need to learn, as early as possible, and I'm not afraid to beat it into you.
Im not bashing him. He started.
Your first mistake is thinking that I was bashing you. You're not important enough for me to bother. Just another noob who gets all insulted and defensive when I tell him that his code sucks. I haven't even gotten into the other problems with your code, and I probably won't if each issue is going to be a battle against your frail little ego.
Im just here asking not to be insulted.
Sorry dude, but bad code is bad code. If you're insulted by me pointing out your bad code, you have insecurity issues that need to be addressed.
Last edited by networkmancer; Sep 7th, 2009 at 11:45 am.
•
•
•
•
I dont care because I dont like what the program will do and I am not the one who made that code actually. Only Case 1 to case 4 is my code and all other is from my classmate. I just copied and paste it then attach my code to Case 1 to case 4 and that case 5 is not mine either..
*plonk*
Last edited by niek_e; Sep 7th, 2009 at 11:58 am.
![]() |
Similar Threads
- Parse error: syntax error, unexpected T_STRING (PHP)
- Syntax error in CREATE TABLE (MS Access and FileMaker Pro)
- Class declaration syntax error (C++)
- php syntax error (PHP)
- Need Urgent HELP-Syntax error, insert "AssignmentOperator Expression" to complete Ass (JSP)
- declaration syntax error? (C++)
- DECLARATION SYNTAX ERROR (for bc 31 user) (C++)
Other Threads in the C++ Forum
- Previous Thread: Manage Errors
- Next Thread: infinte loop
Views: 889 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data database delete desktop developer directshow dll encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream input int integer java lazy lib linux loop looping loops map math matrix memory multidimensional newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






