Search:

Type: Posts; User: Matt13

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Replies
    14
    Views
    7,059

    Thanks for trying it. Works OK on my laptop so...

    Thanks for trying it. Works OK on my laptop so I'll just have to run the prog on that from now on. It's been a strange and futile affair really, like I alluded to in previous posts I have a few progs...
  2. Replies
    14
    Views
    7,059

    Tried code on another computer and everything...

    Tried code on another computer and everything worked fine. I compiled using gcc 3.3 just as before but everything worked fine. Why did this happen?
  3. Replies
    14
    Views
    7,059

    the not-so-magic header file

    the not-so-magic header file
  4. Replies
    14
    Views
    7,059

    Program works for values of N up to 16 and bums...

    Program works for values of N up to 16 and bums out from 18 onwards... It also works for (seemingly) all values of N if I make fprintf go to stdout instead of fptr. It's rather frustrating...

    I...
  5. Replies
    2
    Views
    1,715

    Thanks

    Thankyou. I was aware of the size issue and I forgot to include an int number_of_games thingie.

    Thanks again :)

    (PS: I broke #1 rule of the board and didn't check elsewhere before posting -...
  6. Replies
    2
    Views
    1,715

    Structures: a yes/no question.

    I want to know if you can have a struct with a component that is a pointer to an array of indeterminate length? Say something like:



    struct log {
    int registration_number;
    int *scores;
    }
  7. Replies
    14
    Views
    7,059

    OK yes I may have been misguided in not putting...

    OK yes I may have been misguided in not putting up code. I really can't find the problem even with gdb (although a man with a chisel is not necessarily a sculptor) and I'm getting nowhere...

    This...
  8. Replies
    14
    Views
    7,059

    Sorry I was trying to get down to the heart of...

    Sorry I was trying to get down to the heart of the problem - my code has diagnostic statements all over it and would probably stretch the thread this way and that where it is too wide in places....
  9. Replies
    14
    Views
    7,059

    Segmentation fault with a file pointer?

    Please scroll down to my last post!!

    I am compiling sucessfully using gcc 3.3 but on running my program seg faults. I have isolated the problem as being to do with an fprintf line which is fine if...
  10. Replies
    2
    Views
    1,156

    Thankyou Prelude.

    Thankyou Prelude.
  11. Replies
    2
    Views
    1,156

    Which ffunction do I use?

    Hello,

    I would like to read in a file of the form:

    1 2 1
    1 3 1
    1 4 1
    ....
    2 1 1
    2 4 1
  12. Replies
    7
    Views
    1,527

    The thing is, I want to delete only "deleteme"...

    The thing is, I want to delete only "deleteme" and keep the rest of the array intact, but less that one element. It seems like such a simple thing to do... yet it's driving me nuts!

    I've tried to...
  13. Replies
    7
    Views
    1,527

    Context

    void update(int deleteme, int array[], int size)
    {
    int i,j=0;
    int *temp;
    temp=array;
    while(array[j]!=deleteme)
    j++;
    array=realloc(array,sizeof(int)*(size-1));
    ...
  14. Replies
    7
    Views
    1,527

    *coughs nervously* I might be... ... if I...

    *coughs nervously* I might be...

    ... if I were, what should I do instead?

    (Also , if I used that old line "it seems to work" - what would be a sign that it actually wasn't?)

    Matt
  15. Replies
    7
    Views
    1,527

    Thanks. When I came to code the problem that had...

    Thanks. When I came to code the problem that had provoked the question, I actually found it wasn't an issue.

    None of the online man pages say what happens when you realloc down to a smaller sized...
  16. Replies
    7
    Views
    1,527

    Quick realloc question

    When using realloc to resize an array of say six ints to one of five ints, is it the sixth int "array[5]" that gets junked or is there no protocol?

    Matt
  17. Replies
    3
    Views
    1,864

    Thanks!

    Hmmm! A schoolboy error! Now to fix that error in the deletethings subfunction! :)
  18. Replies
    3
    Views
    1,864

    File

    Sorry!
  19. Replies
    3
    Views
    1,864

    This is driving me nuts.

    OK. There are at least two errors in the attached code (the associated .h file has a few in too I am sure). I get the second when I eliminate most of the references to the array "nodes" which seems...
  20. Replies
    4
    Views
    1,548

    And the moral of the tale is...

    ... always use google!

    http://www.eskimo.com/~scs/cclass/int/sx9b.html (in case anyone else is interested!)
  21. Replies
    4
    Views
    1,548

    Thanks. I have implemented this but the compiler...

    Thanks. I have implemented this but the compiler seems to be having more fun with the declaration of trays generally.
  22. Replies
    4
    Views
    1,548

    Essentially an "array of pointers" problem

    This is definitely my problem area of C. Can anyone point me to a decent tutorial/faq on this? I can't seem to find one on this site but I may well be wrong!

    My problem is essentially this:
    I...
  23. Replies
    2
    Views
    1,316

    Where I think the problem is...

    I think the problem lies within the for loop that I've attached the comment "\\pref attach m nodes" to. I get the feeling that because the 0th case is dealt with seperately, the 2nd case...
  24. Replies
    2
    Views
    1,316

    Why does this code break for m=3?

    This is a program that seeks to represent a network following the Barabasi-Albert algorithm. We start with a randomly generated cluster for an initial n nodes (user input) and then to each of the...
  25. Replies
    3
    Views
    1,036

    Thankyou. A simple idea but so effective. :) ...

    Thankyou.

    A simple idea but so effective. :) I should be able to make everything work from here.
Results 1 to 25 of 45
Page 1 of 2 1 2