Hi, i got error in c program. the program is on arithmatic operation, in this output displaying properly, but when i press enter after seeing output then it will show me error like "stack around variable ch was corrupted"
below is my sample code
- #include<stdio.h>
- #include<conio.h>
-
- void Add(int x,int y)
- {
- printf("%d",x+y);
- }
-
- void main()
- {
- int a;
- int b;
- char ch;
- scanf("%d",&a);
-
- scanf("%s",&ch);
-
- scanf("%d",&b);
-
-
- switch (ch)
- {
- case '+':
- Add(a,b);
- break;
-
- }
-
- getch();
- }
so help me how can i solve this ?