How do I check if a string contains a certain character?

By using strchr(), like this for example: Output: exclamationCheck = 1 If you are looking for a laconic one liner, then you could follow @melpomene’s approach: If you are not allowed to use methods from the C String Library, then, as @SomeProgrammerDude suggested, you could simply iterate over the string, and if any character is the … Read more

Pre increment vs Post increment in array

You hit the nail on the head. Your understanding is correct. The difference between pre and post increment expressions is just like it sounds. Pre-incrementation means the variable is incremented before the expression is set or evaluated. Post-incrementation means the expression is set or evaluated, and then the variable is altered. It’s easy to think … Read more

Implicit function declarations in C

It should be considered an error. But C is an ancient language, so it’s only a warning.Compiling with -Werror (gcc) fixes this problem. When C doesn’t find a declaration, it assumes this implicit declaration: int f();, which means the function can receive whatever you give it, and returns an integer. If this happens to be close enough (and … Read more

Process exited with return value 3221225477

When you scan a number, you need to pass the address of the variable where you want to store the result: where you have Your compiler really ought to have warned you – do you enable warnings when you compile? What is happening here is that the fscanf function writes to the location given (in your case, … Read more

FFT in a single C-file 

Your best bet is KissFFT – as its name implies it’s simple, but it’s still quite respectably fast, and a lot more lightweight than FFTW. It’s also free, wheras FFTW requires a hefty licence fee if you want to include it in a commercial product.