Assist with this matter, i cant seem to understand [closed] - c

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
int main()
{
bool loop = true;
while (loop)
{
loop = reservationCycle();
}
return 0;
}
i keep getting error: ‘reservationCycle’ was not declared in this scope

You havent declared the prototype of that function reservationCycle() It means the compiler doesnt know what reservationcycle is.. you should declare and define the whole function first before using it in main()

Related

I try to get the correct answer from printf, the correct answer is 3 but i keep getting 6 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 days ago.
Improve this question
#include <stdio.h>
#define DEF(x) x*6/x
int main()
{
printf("%d", DEF((12)+(-6)));
return 0;
}
I was not able to get 3 from this code.

"Expected expression"error in my code I don't know what do do from here [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 12 months ago.
Improve this question
Here is a screenshot of my code with the error on line 14
you are declaring a function inside another function. C doesnt allow that
you have
int main(){
int func(....){
....
}
}
etc
You have to do
int func(....){
....
}
int main(){
....
}

Can I Use post increment in function return in C? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
can I use post-increment in a function return in C like this?
int meta_solve() {
//some codes
return metaData[head++]; //head is global variable
}
I asking this question because it showing the different results on windows and mac. thanks for your attention. have a great day!
Yes, that will work.
The return will not happen until the expression metaData[head++] is fully evaluated so the (global) variable head is incremented before the function returns.

array function / error / need for speculation [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
When I implement my code, my function does not work. However, I don't know the reason why. Can you tell me some problems and how to solve it?
Here's my code! And I'm using language C!
You are calling the function in wrong way:
try this:
findMin(n,arr);
findMax(n,arr);
Whenever you are calling function: in function just pass the array name;
Whenever you are calling a array in function just write its array name without [] bracket.

DevC++ is not reading typedef struct in my code [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I'm currently making this program as an activity in class. There's an error popping up when I called the struct inside my main(). I'm posting a picture of the code and where DevC++ was saying where the error is:here's the code
studentRecord[5]; is like doing int[5];.
That will not work.
Provide a variable name.
studentRecord hi[5];

Resources