- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
7 Posted Topics
char *a; array notation: a[i] = 1; pointer notation: *(a + i*sizeof(char)) = 1;
You know that your program can't reach that far because of the integer overflowing problem. Actually this program can be done within one for-loop. Also, i think you can take away the second scanf() out of that while-loop, can you?
Your problem is that you do not have a clear concept on type. first error: Error: argument of type “char” is incompatible with parameter of type “char *. gets() only accepts char* variable, so complied error pops up if you pass a char variable to it. second error: even you …
You are missing some parentheses, make sure you proof-read your code carefully. (at the end of your first function.) Also, you didn't pass any actual parameters to your functions. orz
Also, you can't put a char value to "%s" (@line14 &18). name[i] is a char variable; name is a char array or you may call it string in C);
What a brave man of using a goto statement.... You may try to use another counter to add/minus by 1 if the current number is not a prime number. Then keep doing the procedure of determining a prime number until there is a nearest prime number found.
You can definitely declare variables in the middle of the code using gcc but not on the one provided by microsoft. In the mircorsoft's one, we can only declare our variables at the beginning of our code.
The End.
-[xxxxxxx]-