Search:

Type: Posts; User: Dr Saucie

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,184

    Piping in text output

    I got my program to work fine now I just need to handle user input from command line. They need to be able to pipe in the output of the text file using the cat utility as such

    cat text.txt |...
  2. Replies
    1
    Views
    1,690

    piping output input

    Essentially, I'm trying to pipe the output of a text file, lets call it test.txt, into my C program, lets call it program.

    I assume I would evoke this by typing "cat test.txt | ./program".

    In...
  3. Thread: Sockets

    by Dr Saucie
    Replies
    7
    Views
    1,431

    tried the \n nothing happened still

    tried the \n nothing happened still
  4. Thread: Sockets

    by Dr Saucie
    Replies
    7
    Views
    1,431

    OK well i got my problem fixed, and the last...

    OK well i got my problem fixed, and the last thing i need to do is get this to quit out when someone types quit. i tried if(strcmp(buf_io, "quit") == 0) then break; but this wont work for some odd...
  5. Thread: Sockets

    by Dr Saucie
    Replies
    7
    Views
    1,431

    Sockets

    Hi i wrote a server for a simple chat program and im having a little trouble with my buffer that im sending back and forth. My buffer takes in what the person says and writes it to the other person....
  6. Thread: input in C?

    by Dr Saucie
    Replies
    6
    Views
    1,373

    You definitely don't need to be EOF checking when...

    You definitely don't need to be EOF checking when doing stdin.

    If you're trying to populate an integer array, then you'll be using %d, not %c.



    for ( i = 0; i < 21; ++i )
    {
    scanf (...
  7. Replies
    14
    Views
    2,360

    One last question to complete the program. I'm...

    One last question to complete the program. I'm trying to replace all /t's in the program with a ^I, but I'm not sure exactly how to fit a string into a char spot, or even how to put two chars in...
  8. Replies
    14
    Views
    2,360

    YAY!!! So i ended up putting my flags into a temp...

    YAY!!! So i ended up putting my flags into a temp char array and sending to a sort method and sorting it by priority, then putting the flags back into argv and returning it. That definitely did the...
  9. Replies
    14
    Views
    2,360

    Alright well I have class here in like 30 mins...

    Alright well I have class here in like 30 mins anyways but yeah I wouldn't expect you to write my program. Most of its done anyways im just trying to test all my flags.

    Thanks to both of you I...
  10. Replies
    14
    Views
    2,360

    could you please?

    could you please?
  11. Replies
    14
    Views
    2,360

    I am giving them those names...... is that bad? I...

    I am giving them those names...... is that bad? I haven't had any problems with it yet?

    Also in my case_E im not appending the '$' to the front of the buf im replacing the '\n' with it.

    Another...
  12. Replies
    14
    Views
    2,360

    getopts - prioritizing flags

    I'm writing a Cat program and my program is pretty much coming together but I'm having trouble with the order of flags in command line. Like for example when I
    ./cat -Es test.txt my program puts the...
  13. Replies
    13
    Views
    1,541

    I appreciate the help tabstop - this fixed it! I...

    I appreciate the help tabstop - this fixed it! I had to throw a optind = 1 near the end and it worked out wonderfully.

    I have the -v tag still left to write, and am pretty unclear on exactly what...
  14. Replies
    13
    Views
    1,541

    alright so I figured out how to append things...

    alright so I figured out how to append things (temp char array, sprintf a counter into it, strcat it onto the buf), and so far my code hits all the cases that are necessary, but it only does it to...
  15. try using a switch statement int choice; ...

    try using a switch statement


    int choice;

    printf("please deposite your money by selection:");
    printf("1");
    and so on...

    scanf("%d", &choice);
  16. Replies
    13
    Views
    1,541

    '-u' is ignored..... is there an easy way to...

    '-u' is ignored..... is there an easy way to append numbers to the front of my char buf?
  17. Replies
    13
    Views
    1,541

    ok i get what mean now, ill finish it this way...

    ok i get what mean now, ill finish it this way but i want to try and figure how to append it to the end of a line. Thanks brawski
  18. Replies
    13
    Views
    1,541

    how would i handle multiple commands like "./cat...

    how would i handle multiple commands like "./cat -vET test.txt", because that is how i wrote it first with fgets but then when i wanted to send it to another function that will do something else to...
  19. Replies
    13
    Views
    1,541

    CAT replication

    I'm working on a replication of the Unix/Linux Cat utility, and I'm having some difficulty with its implementation. Right now, I'm using getopts to parse out the command line entry and then handling...
  20. Thread: Realloc

    by Dr Saucie
    Replies
    13
    Views
    2,189

    ok everything seems to work fine now thank you, i...

    ok everything seems to work fine now thank you, i have my cap intialized to 10. In a previous program i had written i had done pretty much the same thing but i was reading in from a binary file and...
  21. Thread: Realloc

    by Dr Saucie
    Replies
    13
    Views
    2,189

    actually i have cap set to 10, and no the first...

    actually i have cap set to 10, and no the first read is inside the loop
  22. Thread: Realloc

    by Dr Saucie
    Replies
    13
    Views
    2,189

    do { cap+=10; ...

    do
    {
    cap+=10;
    buf = realloc(buf, sizeof(char) * cap);
    fread ( buf+cap-10, sizeof( char ), 10, fptr );
    printf("%d\n",...
  23. Thread: Realloc

    by Dr Saucie
    Replies
    13
    Views
    2,189

    i changed it to this do {...

    i changed it to this


    do
    {
    cap+=10;
    buf = realloc(buf, sizeof(char) * cap);
    fread ( buf+cap-10, sizeof( char ), cap, fptr );...
  24. Thread: Realloc

    by Dr Saucie
    Replies
    13
    Views
    2,189

    is there an easier way?

    is there an easier way?
  25. Thread: Realloc

    by Dr Saucie
    Replies
    13
    Views
    2,189

    so then i should put the buf into a temp, realloc...

    so then i should put the buf into a temp, realloc then add the two together?
Results 1 to 25 of 69
Page 1 of 3 1 2 3