Search:

Type: Posts; User: dylan

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    28
    Views
    2,826

    Just before the break set the i to 10 (or...

    Just before the break set the i to 10 (or greater).
    Then the first for loop will stop.

    Dylan
  2. Replies
    13
    Views
    1,619

    The code is compiled from the top down, then it...

    The code is compiled from the top down, then it gets to your jerk call in your main it does not yet know the function.

    So you can move the function up top before main, or prototype the function...
  3. Replies
    7
    Views
    2,275

    See what happens when you print *j a second time...

    See what happens when you print *j a second time right after the first. There is a good chance the first call to printf will use that memory space and the second printf will print "garbage".
    So even...
  4. Thread: bitmap file ..

    by dylan
    Replies
    2
    Views
    1,526

    Your fopen is appending to the file. If you have...

    Your fopen is appending to the file.
    If you have a bad file you're just adding data to it.

    Dylan
  5. Replies
    11
    Views
    2,227

    Wild guess, your open is failing and ofp is null....

    Wild guess, your open is failing and ofp is null.
    You should exit out if its null.

    Dylan

    Also you should move

    Before the open.
  6. Thread: argv problems

    by dylan
    Replies
    29
    Views
    11,144

    You asked how do to get the last argument from...

    You asked how do to get the last argument from argv and you were told
    argv[argc-1] that's a great answer.
    You asked how you access all of argv[] and your were told to loop them, and that is also a...
  7. Replies
    3
    Views
    8,993

    Just put both in an outer for loop that loops 3...

    Just put both in an outer for loop that loops 3 times.
  8. Replies
    11
    Views
    10,086

    Your main needs to be int main(..... and you...

    Your main needs to be int main(.....
    and you also need the return at the end.

    Looks like you used one or the other each time.

    Dylan
  9. Replies
    10
    Views
    1,310

    Then use scanf agian to grab the newline that is...

    Then use scanf agian to grab the newline that is still in the input buffer right after your

    scanf("%c",&ope);


    Or change the scanf to get both at the same time.

    *Note this will not work if...
  10. Replies
    9
    Views
    3,189

    It's just telling you you don't have the source...

    It's just telling you you don't have the source file (bkwrds_str.c) in your current directory
  11. Replies
    9
    Views
    3,189

    "hello_world.c" is just the name of the source...

    "hello_world.c" is just the name of the source file you want to compile.
    If you use the -o option you must tell gcc what name you want to give your compiled program not just the location.

    gcc...
  12. The strncmp only compares n chars, so your sample...

    The strncmp only compares n chars, so your sample program would also match on
    ./program filename getting.
    see strncmp

    You can send me a private message if you want.

    Dylan
  13. Because it's wrong :) if...

    Because it's wrong :)


    if (strncmp(argv[2],"get",3) == 0 ) {

    Dylan
  14. Not sure what to tell you, it should work after...

    Not sure what to tell you, it should work after you fixed the strncmp if statement.

    Maybe post your new code with the fix.

    Dylan
  15. So you changed the if statement for the strncmp...

    So you changed the if statement for the strncmp that NeonBlack pointed out?
    And your printf prints :
    before cmd = send


    Dylan
  16. Replies
    12
    Views
    3,761

    In fileclient check your main arguments (and...

    In fileclient check your main arguments (and getCommandline).

    In your getCommandline() make use of the argc and check how many arguments were passed to your program, so you don't try and access...
  17. Replies
    15
    Views
    7,121

    Something I did was re-write a small program that...

    Something I did was re-write a small program that I already used. If you can pick one that is open source you can go back and see how someone else did it (don't just copy it, look after you have a...
  18. Replies
    93
    Views
    11,750

    The funny part of this is, it was your post that...

    The funny part of this is, it was your post that made me write that code/post.
    You said one comment above mine :


    So I wrote a 5 line program that WILL delete (ok if there was the code the...
  19. Replies
    93
    Views
    11,750

    Hmmm??? The code I posted was a joke, the...

    Hmmm???

    The code I posted was a joke, the first time I ran it it ran fine (Only because I used < 5 chars).
    But my point was just because people's code runs it might not be correct, the second...
  20. Replies
    93
    Views
    11,750

    It's not? So when I put "Dylan...

    It's not?

    So when I put "Dylan /home/dylan/keep_me" into name[6] and the "/home/dylan/keep_me" ends up outside of name[0]-name[5].

    Is there another name for this then??

    Dylan
  21. Replies
    93
    Views
    11,750

    What can go wrong #include int...

    What can go wrong


    #include <stdio.h>
    int
    main(int argc, char *argv[])
    {
    char name[6];
    char folder[] = "/home/dylan/old_folder";
    printf("Enter your name : ");
  22. Replies
    14
    Views
    2,359

    You can not just drop an extra char in that char...

    You can not just drop an extra char in that char array.
    You need to have a new array that will hold the extra chars and just loop through building the second one.
    Something like this


    for ( i =...
  23. Replies
    8
    Views
    1,571

    You only set a value to meter if lights is not...

    You only set a value to meter if lights is not (G,g,A,a) but you always check to see if its > 50.
    If that's what you want just set it to 0 when you initialise it

    int meter = 0;

    The complier is...
  24. Thread: Realloc

    by dylan
    Replies
    13
    Views
    2,189

    Make sure cap starts as 0, also num_items. And...

    Make sure cap starts as 0, also num_items.
    And make sure your buf pointer points to NULL (or points to valid malloc'ed memory) or the realloc will try and work with memory it might *not* be able to....
  25. Replies
    8
    Views
    1,571

    Both inlet and meter are defined as char, but you...

    Both inlet and meter are defined as char, but you scanf them as int's

    scanf ("%i", &inlet);

    Also you are going to have nelines in your input bufer after the scanf so you will need to get rid of...
Results 1 to 25 of 29
Page 1 of 2 1 2