Awesome!!! It works!!! Many thanks!
Type: Posts; User: Nessarose
Awesome!!! It works!!! Many thanks!
Like this?
printf("%c\n", (*text)[4]);
arg_vector prints correctly. The error returned by perror is: perror: Bad address.
Am I initializing arg_vector correctly?
Try this: http://www.opengroup.org/onlinepubs/009695399/functions/poll.html
In main() you're re-declaring the functions. Change it to:
int main()
{
takeinput();
bubblesort();
}
I must be missing something here. I'm trying to use execvp to execute a command that a user passes to it. The way I'm doing this is by creating an arg_vector that stores the tokens of the command....
Yes, was that wrong?
So the child processes on the server side are writing directly to the file descriptors which are used for sending data back to each client?
Yes. This is the snippet of code I have that takes the...
Hello, I'm writing a server side program that needs to run a program on the UNIX server using execl() or execlp(), and I need to somehow return this output back to the client side. The server handles...
Or you could use strtok() and just pass ":" as the delimiter.
This doesn't look like a single line of code. At an initial glance, it seems to add words to a dictionary.
Well, think about the algorithm you'd use to go about doing it. You want the first 6 elements of one array. How do you normally access an element in an array? How do you set the contents of an array,...
See, this is why people don't like K&R. ;)
*ducks*
I would suggest reading up on recursion. If you don't understand how that works, you're not going to be able to write the program.
This is pretty good: http://www.iota-six.co.uk/c/
One way to do this would be to create an array that represents all the characters in the alphabet and to initialize the contents to 0. You can then increment the contents by 1 the first time a...
And if you're using C99 you could include the int i in the for loop itself:
for (int i = 0 i < n; i++)
Simple port scanner maybe? You get to learn socket programming along the way.
Ok, this is what I meant:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DELIM " \n\t"
You could make use of strtok() to tokenize the sentence into separate words and then use strlen() to determine which is the longest.
Copy and paste it?
From http://www.faqs.org/faqs/C-faq/faq/
If you're not sure what the dimensions are, perhaps it would be better to create a dynamic data structure that can grow and shrink. Perhaps a linked list.
http://www.hermetic.ch/cfunlib/arrays/arrays.htm
What does your code look like? It prints out fine for me:
double x = 23.00;
long y = x;
printf("%ld\n", y);