Search:

Type: Posts; User: mdj441

Search: Search took 0.00 seconds.

  1. Your function correctly accepts pointers as...

    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 ...
  2. Thread: Compile Errors

    by mdj441
    Replies
    4
    Views
    1,828

    What words don't you understand? If it's the the...

    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...
  3. It looks like you're trying to debug it, but the...

    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...
  4. Replies
    28
    Views
    7,715

    If you can access it as F:\ from everywhere else,...

    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...
  5. Alright, I understand. That's probably a step 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...
  6. Thread: Compile Errors

    by mdj441
    Replies
    4
    Views
    1,828

    It's important to realize that the compiler...

    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...
  7. Thread: Compiler

    by mdj441
    Replies
    17
    Views
    5,648

    You mean something where you can just ...

    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...
  8. Your change works because you're just duplicating...

    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...
  9. Thread: conio.h??

    by mdj441
    Replies
    4
    Views
    1,358

    If you were to search for conio.h, one of the...

    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...
  10. Replies
    28
    Views
    7,715

    Maybe this thread...

    Maybe this thread helps? You seem to be having the same problem.
  11. Replies
    8
    Views
    1,444

    Woah. I never thought... wow. Awesome news.

    Woah. I never thought... wow. Awesome news.
  12. If you mean a for loop could be imitated using a...

    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.
  13. There was a teacher in my high school who taught...

    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...
  14. Replies
    6
    Views
    1,060

    From what I understand, void*s are no good for...

    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.
    ...
  15. Replies
    7
    Views
    13,354

    And just think about functions you already use:...

    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...
  16. Thread: Best colour?

    by mdj441
    Replies
    6
    Views
    1,406

    If you're talking about system("COLOR 0A");...

    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...
  17. Replies
    8
    Views
    1,444

    If you do mean obfuscation, it's terrible...

    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...
  18. Replies
    10
    Views
    2,264

    The important difference is that &vocali is a...

    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*.
Results 1 to 18 of 18