Search:

Type: Posts; User: Ian

Search: Search took 0.00 seconds.

  1. Thread: close and fclose

    by Ian
    Replies
    4
    Views
    5,265

    Thanks Quzah That explains it a bit more for...

    Thanks Quzah

    That explains it a bit more for me, although I did leave out one valuable piece of information, I am actually using named pipes(FIFO's) so I don't think it gets opened the same way as...
  2. Thread: close and fclose

    by Ian
    Replies
    4
    Views
    5,265

    close and fclose

    I was curious as to what the difference is between a FILE * stream (which fclose closes) and an int fd (which close closes).

    And also, is there a problem with opening a pipe using fopen, I am...
  3. Replies
    3
    Views
    2,595

    problems with gtk+, and xlib

    First off, I'm kind of curious as to what other people use... gtk+? xlib?

    any suggestions? before I get too deep into one?

    Secondly, I was first trying to make some sample code compile using...
  4. Replies
    11
    Views
    1,481

    I believe that code misses the first character of...

    I believe that code misses the first character of the string, to fix that you might do something like

    for (i = strlen(s); i >= 0; --i)

    you're also missing the newline character, but I assume...
  5. Replies
    2
    Views
    1,077

    pnumber is passed to the function change() ...

    pnumber is passed to the function change()

    result = change(pnumber);

    therefore the value that pnumber points to can be multiplied by 2 in change() because change() has a copy of the pointer.
    ...
  6. Thread: PCH creation point

    by Ian
    Replies
    4
    Views
    2,056

    I believe I used to get that error when I forgot...

    I believe I used to get that error when I forgot to put a semicolon after the closing brace of a class.


    class blah
    {
    };

    Then again, maybe it was for some other reason....

    (: Ian
  7. Thread: c

    by Ian
    Replies
    15
    Views
    2,012

    um..

    I actually meant his faster computer, as it happened to be the one that would not finish loading the page, whereas the slower of the two computers did load it up properly.

    Networking is awesome.
    ...
  8. Thread: c

    by Ian
    Replies
    15
    Views
    2,012

    haha

    hehe, that's pretty odd, perhaps "they don't make 'em like they used to"?

    j/k
    thanks for explaining,

    (: Ian
  9. Thread: c

    by Ian
    Replies
    15
    Views
    2,012

    say who?

    PHP is server-side is it not? So shouldn't PHP get run anywhere you connect to it from?



    Tell me if I'm wrong...



    Ian (:
  10. Replies
    4
    Views
    1,926

    Thanks!

    Thanks for all the input guys, it makes a lot more sense to me now.


    (: Ian
  11. Replies
    4
    Views
    1,926

    another malloc question

    ok, here goes...
    If I have fp = malloc(3*sizeof(int)); fp now points to the memory address of the first int of 3 that have been allocated for my use. When I use free(fp); it frees those 3 ints.
    ...
  12. Thread: malloc question

    by Ian
    Replies
    3
    Views
    1,761

    thanks much

    Thanks much Salem, I included stdlib.h and removed the cast and it worked great...

    You're up a bit early eh?

    Thanks again (:

    Ian
  13. Thread: malloc question

    by Ian
    Replies
    3
    Views
    1,761

    I got a fix...

    Nevermind I got a fix (: thanks anyhow

    it was:

    intp = (int*)malloc(3*sizeof(int));

    still a bit curious though, do you guys usually cast it as whatever type of pointer it is? or do you do it...
  14. Thread: malloc question

    by Ian
    Replies
    3
    Views
    1,761

    malloc question

    I haven't done much with memory allocation, and I'm getting a warning from gcc when I try and compile it, it says "warning: assignment makes pointer from integer without a cast"

    /*These are the...
  15. Replies
    4
    Views
    14,789

    You should be able to close the file from your...

    You should be able to close the file from your main() function or your other function, I don't think it really matters WHERE you close it, as long as you make sure it gets closed...

    (:
  16. Thread: Me.

    by Ian
    Replies
    43
    Views
    7,438

    what? no picture?!?

    I couldn't get the picture either, tripod says they're hosting it and it's not available for download
  17. Replies
    9
    Views
    4,386

    minor note

    uhh.. cnt should start at 0 not 1
    because you're skipping the first question when it starts at 1

    anyway, a minor note (:

    Ian
  18. Replies
    3
    Views
    1,172

    frowny face

    uh... there's a frowny face in your code man ):
  19. Replies
    4
    Views
    1,857

    Troll found the problem

    If you add the '&' as Troll suggests that gets rid of the segmentation fault.

    Example: scanf("%d",&q);

    I don't really know how to explain what your function is doing. It is calling itself...
  20. Thread: System pauses

    by Ian
    Replies
    2
    Views
    978

    I realize this isn't what you asked for...

    /*START CODE BLOCK*/
    #include <stdio.h>
    #include <unistd.h>

    int main()
    {
    printf("Starting delay.\n");
    sleep(5);
    printf("Ending delay.\n");
  21. Thread: Continous loop

    by Ian
    Replies
    1
    Views
    1,656

    do you mean a for loop?

    /*BEGIN CODE BLOCK*/
    #include <stdio.h>

    int main()
    {
    char buffer[80];
    int coordinates[6];
    int i;

    for (i=0; i<6; i++)
Results 1 to 21 of 21