Hi again, i started programming c like 8 hours ago and i'm going to take a break when this program is working
I know there are probably heaps better ways of doing this i just wanted to see if i could write a function on my own without notes but it doesnt look like i can yet.
Code:
#include <stdio.h>
#include <strcmp.h>
main()
{
char c;
char d;
printf("Hi, I am the name genie and i am good at addition\nWhat would you like to do?\nPress A to subtract or B to get insight into your name");
scanf("%s",c)
if(!strcmp(c,a))subb;
else nam;
return 0;
}
subb()
int r;
int t;
int q;
{
printf("Please enter a number the press enter : ");
scanf("%d",&r);
printf("What would you like me to add to that number? : ");
scanf("%d",&t);
q=r+t;
printf("%d plus %d equals %d",r,t,q);
return 0;
}
nam()
char x[20];
char kate[9];
{
printf("Please enter your name : ");
scanf("%s",x);
if(!strcmp(x,kate))
printf("Thats a great name!!!!");
else printf("Ha, what a crap name!!!");
return 0;
}
i get these errors
c:\program files\microsoft visual studio\vc98\include\stdio.h(1) : warning C4182: #include nesting level is 363 deep; possible infinite recursion
c:\program files\microsoft visual studio\vc98\include\stdio.h(1) : fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit
is this the right kind of layout for a program?