Using pointer to char array, values in that array can be accessed?

When you want to access an element, you have to first dereference your pointer, and then index the element you want (which is also dereferncing). i.e. you need to do: printf(“\nvalue:%c”, (*ptr)[0]); , which is the same as *((*ptr)+0) Note that working with pointer to arrays are not very common in C. instead, one just use a … 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

Categories c Tags

gdb: No symbol “i” in current context

It has probably been optimised out of your compiled code as you only use feature_mask[i] within the loop. Did you specify an optimization level when you called your compiler? If you were using gcc, then just omit any -O options and try again.

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

Categories c Tags

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.

Categories c Tags ,
Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)