Home › Forums › C Programming › Linker Errors, i do believe i need help › Re: Re: Linker Errors, i do believe i need help
March 19, 2009 at 10:15 pm
#3525
AnnelieSchoenhe
Participant
Before i start, i fortunetly was able to fix the Linker errors. I fear i may have more of them later, but when that time comes, i’ll fix them. Now i have new errors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | //A basic two in one program used for studying functions and arithmatic.<br /> //Created by Deathscreton on 5:08 PM 3/20/09<br /> #include <stdio.h><br /> <br /> addition()<br /> { do<br /> {<br /> char counter,addy,back,exit,yes,no;<br /> int count;<br /> int a;<br /> int b;<br /> int sum;<br /> count=0;<br /> counter='d';<br /> addy='g';<br /> back='f';<br /> exit='k';<br /> yes='n';<br /> ++count;<br /> <br /> printf("Please enter the first number: n");<br /> scanf("%d",&a);<br /> printf("You've entered %d, is this correct? Y for yes, n for no.",a);<br /> scanf("%c %c",&yes, &no);<br /> if (yes=='y')<br /> {<br /> printf("Please enter the second number: n");<br /> scanf("%d",&b);<br /> printf("You've entered %d, is this correct? y for yes, n for no.",b);<br /> scanf("%c %c",&yes, &no);<br /> if (yes=='y')<br /> {<br /> sum=a+b;<br /> printf("The answer of the numbers entered is %d. Would you like to run this again?",sum);<br /> scanf("%c %c",&yes, &no);<br /> if (yes=='y')<br /> {<br /> addition();<br /> }<br /> else (no=='n');<br /> {<br /> main();}<br /> }<br /> else (no=='n');<br /> {<br /> addition();<br /> }<br /> }<br /> }while (count < 48793);<br /> <br /> }<br /> <br /> <br /> <br /> counting()<br /> {<br /> <br /> do<br /> {<br /> int count;<br /> char yes;<br /> char no;<br /> char exit;<br /> exit='e';<br /> count=-89898;<br /> yes='h';<br /> no='b';<br /> printf("Press 'x' to exit the counter, press any other key to start. n");<br /> scanf("%c",&exit);<br /> if (exit=='x')<br /> { break;}<br /> do<br /> {<br /> ++count;<br /> printf("The counter is now at %d n",count);<br /> }while (count < 898989);<br /> printf("The final count number is %d n",count);<br /> printf("Would you like to run the counter again? y for yes n for no.");<br /> scanf("%c %c",&yes,&no);<br /> if (yes=='y');<br /> {counting();}<br /> else (no=='n');<br /> {main();}<br /> }while (exit=='b');<br /> }<br /> }<br /> <br /> <br /> int main()<br /> {<br /> char start;<br /> char counter;<br /> char addy;<br /> char back;<br /> char exit;<br /> char yes;<br /> char no;<br /> int count;<br /> int a;<br /> int b;<br /> int sum;<br /> count=-897989;<br /> counter='d';<br /> addy='g';<br /> back='f';<br /> exit='k';<br /> yes='n';<br /> start='o';<br /> <br /> printf("Welcome to the Basic two in one program created by Deathscreton(a small time coder on his way to PSP homebrew.) n");<br /> printf("This Basic two-in-one program contains a primative addition calculator and a high sped up counter from the numeric number -897989 to +48793. n");<br /> printf("You will now be prompted to chose the Addition calculator, or the counter. n");<br /> printf("For the addition calculator, press a then enter. For the counter, press c then enter. To exit the program, press x then enter. n");<br /> scanf("%c %c",&addy,&counter,&exit);<br /> if (addy=='a')<br /> {addition();}<br /> else (counter=='c');<br /> {counting();}<br /> else (exit=='x')<br /> {break;}<br /> return 0;}<br /> |
Thats the code, now here are the current errors:
In function ‘addition’:
Line 49 :’count’ undeclared (first use in this function
(Each undeclated identifier is reported only once
for each function it appears in.)
In function ‘counting’:
Line 82: syntax error before “else”
Line 84: ‘exit’ undeclared(first use in this function)
At top level:
Line 86: syntax error before ‘}’ token
In function ‘main’:
Line 119: syntax error before “else”
Those are the errors. I don’t understand why the pop up. I fix one, and another two take that one’s place. What in the world is going on?