Your function correctly accepts pointers as that's what fscanf() needs, so you need to pass it pointers: either
load_array_from_file(&var_from_main, ...) // NOT var_from_main[] or ...
Type: Posts; User: mdj441
Your function correctly accepts pointers as that's what fscanf() needs, so you need to pass it pointers: either
load_array_from_file(&var_from_main, ...) // NOT var_from_main[] or ...
What words don't you understand? If it's the the talk of functions and pointers that bug you, start simpler and focus on understanding those things first before you continue with this project. It...
It looks like you're trying to debug it, but the output window at the bottom says your build failed.
Try building again, but keep an eye out for compiler/linker errors.
And it also looks as if...
If you can access it as F:\ from everywhere else, you should be able to do it that same way using fopen().
Isn't that what you want?
I would only blame it on fopen() if it returns NULL in...
Alright, I understand. That's probably a step in the right direction.
You should be passing the address of your variables to load_array_from_file() to use in fscanf() because fscanf() expects...
It's important to realize that the compiler messages are telling you all you need to know. Just take some time and try to understand them.
So what's your prototype for readdir?
struct...
You mean something where you can just
compiler mycode.c -o myprog.exe
?
Though most people would recommend Visual Studio or Pelles C, you might consider TCC if you're just looking for a...
Your change works because you're just duplicating your prototype from line 3 without calling the function.
The fact that you'd write your code like that implies you haven't really dealt with...
If you were to search for conio.h, one of the first things that would come up is its Wikipedia entry:
... Which pretty much sums up why you should be avoiding it even if you have it.
I...
Maybe this thread helps? You seem to be having the same problem.
Woah. I never thought... wow. Awesome news.
If you mean a for loop could be imitated using a macro that expands to a while loop, I'd agree. But the the keyword for itself is definitely unrelated to the preprocessor.
There was a teacher in my high school who taught C++ or, as his website put it, "C." He gave all his students a copy of Turbo C++ 2.x (or so) for DOS through 2007-ish when he upgraded to 4.0. It...
From what I understand, void*s are no good for function pointers: faq
For ex., I got
error: ISO C forbids initialization between function pointer and ‘void *’ when trying something similar.
...
And just think about functions you already use: imagine if you had to rewrite the entire code for printf() in main() every time you wanted to print some text on the screen. Pretty ridiculous! Where...
If you're talking about
system("COLOR 0A");
or something like that, I'd leave it default too.
system() actually executes an external command, which is generally something you should...
If you do mean obfuscation, it's terrible security. If your code is meant to be secret, you're better off not giving it out at all.
But it can be fun to do anyway. I've made things like this and...
The important difference is that &vocali is a char(*)[6] (ie. "pointer to array 6 of char"). So it is actually a completely different type than char*.