Search:

Type: Posts; User: kevinstrijbos

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    1,211

    NVM.

    NVM.
  2. Replies
    4
    Views
    1,211

    FILE I/O standard stream, can't write.

    NVM.
  3. Yes, your arguments are valid. Reaching an...

    Yes, your arguments are valid. Reaching an element takes longer indeed, but it takes less resources.
    For example: If you have a text file with 500 words and you declare an array with 50 000 structs,...
  4. Well, after reading the first comment I was like:...

    Well, after reading the first comment I was like: hell no.
    An array of 50 000 structs? Not a good way to make a habit of coding efficiently.
    A linked list would be the solution here
  5. BTW, I compiled, linked and runned it with Visual...

    BTW, I compiled, linked and runned it with Visual Studio 2010, so I don't have to worry about linking. The code works fine, no problem with the files.
    So my guess is that I didn't link the files...
  6. Just before my main. ...

    Just before my main.

    References.h->References.c->List.h->List.c->Files.h->Files.c->Bibliography.h->Bibliography.c->Main

    And yes, I watch the capitalisation of my filenames, don't worry :D
  7. In bibliography.c Code: /* AUTH: Kevin...

    In bibliography.c

    Code:


    /* AUTH: Kevin Strijbos
    DATE: 26/02/2012
    DESC: contains functions to work with the reference list. */

    #include "Bibliography.h"
  8. Replies
    7
    Views
    980

    Without checking your code, you know that the...

    Without checking your code, you know that the file name is counted as a parameter?
    For example, if you put: find whatever, argc is 2 than. So the parameter you entered (whatever) can be read with...
  9. Replies
    7
    Views
    980

    Click start, type in search box "CMD", open it,...

    Click start, type in search box "CMD", open it, use the cd command to go to the directory where your program is located, type in: programname -parameters-, instead of programname you type the name of...
  10. Modular programming: undefined reference. Help pls!

    Hello,

    I'm writing a modular program. However, the compiler complains that it can't find the function create_list, but this function is declared in Bibliography.h

    The precise error is:...
  11. Replies
    5
    Views
    1,856

    Oh excuse me, I ment inner loop

    Oh excuse me, I ment inner loop
  12. Replies
    5
    Views
    1,856

    Oh, and btw, you get the seg fault because of...

    Oh, and btw, you get the seg fault because of this piece: if(a[j]>a[j+1])

    In the outer loop you let j loop till you reached the end of the array, but then, in the inner loop you want to check...
  13. Replies
    5
    Views
    1,856

    BUBBLE SORT (Java, C++) | Algorithms and Data...

    BUBBLE SORT (Java, C++) | Algorithms and Data Structures, look here.
    You got your algorithmn wrong, that isn't bubble sort, and I'm quite sure it also won't work.
  14. The array name itself is "sort of" a pointer, so...

    The array name itself is "sort of" a pointer, so no need to do something weird with the *'s...
    Just pass the name of an array, and receive it as a two dimensional array like char array[][COLUMNS]
  15. Oh and btw, it's just a little detail. But it'd...

    Oh and btw, it's just a little detail. But it'd be better if you start your counter at 0 and let it loop while counter < n, everything in IT starts with 0...
  16. if (count == 1) { min = x; max = x; }...

    if (count == 1)
    {
    min = x;
    max = x;
    }
    else if (x < min)
    min = x;
    else if (x > max)
    max = x;
  17. Aaah, now I see. Thanks for the help!

    Aaah, now I see. Thanks for the help!
  18. But the problem with fgets is that I don't know...

    But the problem with fgets is that I don't know how long the line is, when I let fgets copy 80 characters to my buffer, but the line is only 20 chars long. What then? Also, how can I check for an EOF...
  19. So, this is (how I think) it should work: - I'm...

    So, this is (how I think) it should work:
    - I'm reading char per char from the file, when the char is equal to the EOF signal I quit.
    - I keep track of where I am in the file, so I can easily put...
  20. Ow, I see I didn't post my real code, I was...

    Ow, I see I didn't post my real code, I was playing with some things. I don't want to print the characters, I want to print the amount of words per line (I assume that a line ends with \n). Sorry, my...
  21. I already thought it'd be something like that, so...

    I already thought it'd be something like that, so I've made a help pointer which I made equal to fpntr in the beginning. I thought that help wouldn't get updated, but apparently it did and I got the...
  22. Wow, let me try it again. /* AUTH: Kevin...

    Wow, let me try it again.



    /* AUTH: Kevin Strijbos
    DATE: 15/02/2012
    DESC: excercise 15.1 */

    #include <stdio.h>
    #include <string.h>
  23. Counting words per line from a file (fopen)

    Hello, I'm trying to write a program which reads the amount of words per line from a file. However, it won't work. For some reason, it skips the first line of the file, the 2nd line is right but the...
  24. Replies
    7
    Views
    1,065

    Well, after a lot of trouble with ctrl+f I...

    Well, after a lot of trouble with ctrl+f I managed to change the names!
  25. Replies
    7
    Views
    1,065

    No, q also changes the value in list. Note that p...

    No, q also changes the value in list. Note that p = *list, and after that q = p.
    And indeed, it'd be better to initialise q, also the names could be better.
    But the matter is that the loop doesn't...
Results 1 to 25 of 69
Page 1 of 3 1 2 3