Search:

Type: Posts; User: Gav D

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,057

    do you really need to allocate memory for all the...

    do you really need to allocate memory for all the pointer though surley thats done when you declare rptr? I dont get why its using the malloc for rptr and why the program works fine when I remove it?
  2. Replies
    6
    Views
    1,286

    sorry I know it then terminate the string and the...

    sorry I know it then terminate the string and the program wouldnt show the left over value form the old variable but would it still be in memory or would that be cleared?
  3. Replies
    3
    Views
    1,057

    Another Pointer Q

    Ive been reading through a tutorial on pointer I found on here and have understood it so far. Im now looking at a sample program that creates a 2 dimensional array at run time. I can understand it...
  4. Replies
    6
    Views
    1,286

    would the \0 clear the end of the old string?

    would the \0 clear the end of the old string?
  5. Replies
    6
    Views
    1,286

    why codes this work?

    I wrote a string copy routine for learning purposes and then I dellibratly made it leave the \0 off the destination string and it still works why is this?




    char *chrstrcpy(char *des,char...
  6. Replies
    2
    Views
    1,366

    easy variable question

    is it jsut string that are terminated by \0 or are there any other types that use this?
  7. Replies
    17
    Views
    2,785

    stupid question : if older compilers didnt add...

    stupid question : if older compilers didnt add the /0 at the end of string for you but the ne wones do what happens if in a new compiler you add the /0 will the compiler add another to the end of...
  8. Thread: structures

    by Gav D
    Replies
    10
    Views
    1,327

    can anyone tell me why GCC give me '29 : invalid...

    can anyone tell me why GCC give me '29 : invalid type for argument 1 of get response? Dont ask me why I need the pointer for the structure in getresponse, I do I just havent written the code for it...
  9. Thread: structures

    by Gav D
    Replies
    10
    Views
    1,327

    GCC has a problem with int...

    GCC has a problem with

    int otherfunction(struct *test);

    it says error before *. is the * definatly suposed to be there?
  10. Thread: structures

    by Gav D
    Replies
    10
    Views
    1,327

    Thanks thats what I wanted.

    Thanks thats what I wanted.
  11. Thread: structures

    by Gav D
    Replies
    10
    Views
    1,327

    Do I not need to pass a pointer if I wish to edit...

    Do I not need to pass a pointer if I wish to edit the contents of the sturcture in the other function?
  12. Replies
    4
    Views
    1,103

    Thanks I understand now, are there situations...

    Thanks I understand now, are there situations when you want to call a function by its pointer then? GCC wasnt giving me any warnings.
  13. Thread: structures

    by Gav D
    Replies
    10
    Views
    1,327

    structures

    I have a structure declared in main and I want this to be avaliable to another function so I assume I need to pass a pointer to the other function ? how is this done.



    otherfunction(*ptr);
    ...
  14. Thread: What does -> Do

    by Gav D
    Replies
    1
    Views
    923

    Either that or im skimming over important areas...

    Either that or im skimming over important areas by mistake :)
  15. Replies
    4
    Views
    1,103

    What does it do when I just call displaymenu? Is...

    What does it do when I just call displaymenu? Is displaymenu a pointer and displayermenu() a function call then?
  16. Thread: What does -> Do

    by Gav D
    Replies
    1
    Views
    923

    What does -> Do

    As above what does the -> mean in c?
  17. Replies
    4
    Views
    1,103

    Calling A Funtion

    Can anyone see whats wrong with the following code its not running the displaymenu function its going striahgt over it I think



    #include <stdio.h>

    int displaymenu ();


    int main ()
  18. Thread: simple program 2

    by Gav D
    Replies
    7
    Views
    1,743

    also sorry to sound stupid but can some explain...

    also sorry to sound stupid but can some explain this

    while ( getchar() != '\n' );

    is this clearing out the buffer? im guess getchar is taking the contents ofthe input buffer one by one until it...
  19. Thread: simple program 2

    by Gav D
    Replies
    7
    Views
    1,743

    ok so other than that the concepts look ok? also...

    ok so other than that the concepts look ok? also intFST was initialised just a bit further down
  20. Thread: simple program 2

    by Gav D
    Replies
    7
    Views
    1,743

    the first 2 scanfs work fine if I enter 4 then 5...

    the first 2 scanfs work fine if I enter 4 then 5 it comes out with 4*5 it just doesnt work on the try again one? can you show me in my code what I need to change? other than the scanfs does...
  21. Thread: Program Name

    by Gav D
    Replies
    3
    Views
    1,141

    not sure if this answers you question or not but...

    not sure if this answers you question or not but with my compiler I use

    gcc prog.c -o outfile.exe

    outfile.exe being the name of the file the compiler will create.
  22. Thread: simple program 2

    by Gav D
    Replies
    7
    Views
    1,743

    simple program 2

    ok below is a sample program I used to
    multiple 2 numbers the numbers can be
    more than 1 digit,. I know its long winded
    and the functions are not needed but I was
    just trying to get to grips...
  23. Replies
    10
    Views
    1,322

    ok I rewrote the program and it now works can you...

    ok I rewrote the program and it now works can you just tell me if the following code is how you would have done it? You lot seem to not like the scanf function but getchar was only obviously taking...
  24. Replies
    10
    Views
    1,322

    OK I understand this now, but I now think all its...

    OK I understand this now, but I now think all its storing in itst is \n or return as im now getting

    ' is at 6cffdc"
  25. Replies
    10
    Views
    1,322

    thanks I have made that change and it now gives...

    thanks I have made that change and it now gives the following results...


    Enter No. For Variable : 3
    51 is at 6cffdc

    if I pass 4 into it it give result as 52 and so on. Any ideas?

    Taking...
Results 1 to 25 of 28
Page 1 of 2 1 2