Is there a site like this for C Programming?

Hello everyone. I used to come here for learning C++ but now I'm leaning C. So I want to know that can I post problems related to C programming here? Is there any other site like this for C too?If yes. Do tell me. Because this is the best site I know and everyone here is really kind and helpful.

This is my code btw. Every time I run it. It compiles and run. Lets me enter a value then this error occurs " C Programming.exe has stopped working "


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  #include <stdio.h>

int main(void)
{
	int donuts;
	int loopcount;
	int total;
	int average;
	
	while (loopcount <5)
	{
		printf("Enter the number of donuts you ate:");
		scanf("%d\n", donuts);
		loopcount++;
		total = total + donuts;
	}
	
	average = total/5;
	printf("The average of donuts eaten is: %d", average);
	
	getch();
	
}
Last edited on
Several issues, but firstly, you need to pass &donuts to scanf().
loopcount is not initialized.
closed account (z05DSL3A)
You also need to initialise your variables.
Thank you so much everyone. Such a silly mistake and I was going crazy that my compiler isn't working :D

Anyhow. It means I can post here for my C programming problem. Right?
Anyhow. It means I can post here for my C programming problem. Right?
Yes. Though some members here are highly skilled in C++, but rather less so in C. (No disrespect intended to anyone).
@Chervil: Thank you for clearing that up.
If you post C questions here I recommend that you make it very clear that you are asking about C (mentioning C in the topic title is probably a good idea) because otherwise there is a big chance that people will yell at you for not using modern C++ features.
Peter87 wrote:
If you post C questions here I recommend that you make it very clear that you are asking about C (mentioning C in the topic title is probably a good idea) because otherwise there is a big chance that people will yell at you for not using modern C++ features.

Quoted for relevance.

In your journey to master the C language, you might find these links relevant:

References, FAQ's, tutorials:
http://en.cppreference.com/w/c
http://c-faq.com/
http://www.cs.cf.ac.uk/Dave/C/
https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Coding+Standard

C "fan site":
http://crypto.stanford.edu/~blynn/c/

A good C IDE for Windows:
http://pellesc.de/

Alternative forums (you are more than welcome to keep asking C questions here though):
http://forum.pellesc.de/
http://stackoverflow.com/questions/tagged/c

Good luck.
cprogramming.com
Ok everyone. Thank you so much !
Topic archived. No new replies allowed.