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 |...
Type: Posts; User: Dr Saucie
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 |...
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...
tried the \n nothing happened still
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...
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....
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 (...
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...
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...
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...
could you please?
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...
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...
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...
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...
try using a switch statement
int choice;
printf("please deposite your money by selection:");
printf("1");
and so on...
scanf("%d", &choice);
'-u' is ignored..... is there an easy way to append numbers to the front of my char buf?
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
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...
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...
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...
actually i have cap set to 10, and no the first read is inside the loop
do
{
cap+=10;
buf = realloc(buf, sizeof(char) * cap);
fread ( buf+cap-10, sizeof( char ), 10, fptr );
printf("%d\n",...
i changed it to this
do
{
cap+=10;
buf = realloc(buf, sizeof(char) * cap);
fread ( buf+cap-10, sizeof( char ), cap, fptr );...
is there an easier way?
so then i should put the buf into a temp, realloc then add the two together?