C Makefile – missing seperator. stop
Makefile requires that all “commands” in a rule are indented by one tab. You have, for example, this rule: That is wrong, the command-line should be intended with an actual tab (not spaces) like
Makefile requires that all “commands” in a rule are indented by one tab. You have, for example, this rule: That is wrong, the command-line should be intended with an actual tab (not spaces) like
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
In C, you can use the built in qsort command: see: http://www.cplusplus.com/reference/clibrary/cstdlib/qsort/ To answer the second part of your question: an optimal (comparison based) sorting algorithm is one that runs with O(n log(n)) comparisons. There are several that have this property (including quick sort, merge sort, heap sort, etc.), but which one to use depends on your use … Read more
You can’t return two values. However, you can return a single value that is a struct that contains two values.
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
In C I typically create a function in the style of a constructor which does this. For example (error checking omitted for brevity)
This error occurs because some other part of your code has corrupted the heap. We can’t tell you what that error is without seeing the rest of the code. The fact that FINE 7 is not printed tells you that realloc is failing. And that failure must be because buffer is invalid due to a heap corruption earlier in the execution. … Read more
I think you are confused about how the compiler puts things together. When you use -c flag, i.e. no linking is done, the input is C++ code, and the output is object code. The .o files thus don’t mix with -c, and compiler warns you about that. Symbols from object file are not moved to other object files like that. All object … Read more
From what the error message complains about, it sounds like you should rather try to fix the source code. The compiler complains about difference in declaration, similar to for instance and this is not valid C code, hence the compiler complains. Maybe your problem is that there is no prototype available when the function is … Read more
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