C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’

Two errors here: first, you’re trying to declare arrays[63] for storing 64 elements, as you’ve probably confused the size of array (n) with the maximum possible index value (that’s n – 1). So it definitely should be litera[64] and liczba[64]. BTW, you have to change this line too – while (i<=64): otherwise you end up trying to access 65th element. And second, you’re trying … Read more

C Error: declaration shadows a local variable — Won’t let me repeatedly replace the value of my float variable

Replace float cents = with cents = in your while loops. Currently you’re trying to declare a new variable cents which shadows the existing one. Technically this is valid C, perhaps your compiler (thankfully) has this warning set to an error? Note that you could optimise much of your logic to O(1) using integer division and careful checking with your debugger. Repeatedly subtracting from a value is … Read more

Invalid write of size 1

you end up with cant_corte[i] is 0, and then you strv[i][cant_corte[i] -1] = ‘\0’; so strv[i][-1] is not a valid address to write. i do encourage you to learn how to use valgrind with gdb as explained at http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver-simple

strtok segmentation fault

The problem is that you’re attempting to modify a string literal. Doing so causes your program’s behavior to be undefined. Saying that you’re not allowed to modify a string literal is an oversimplification. Saying that string literals are const is incorrect; they’re not. WARNING : Digression follows. The string literal “this is a test” is of an expression of type char[15] (14 … Read more

Example of waitpid() in use?

Syntax of waitpid(): The value of pid can be: < -1: Wait for any child process whose process group ID is equal to the absolute value of pid. -1: Wait for any child process. 0: Wait for any child process whose process group ID is equal to that of the calling process. > 0: Wait for the child whose … Read more

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