Thanks Salem! Just one more thing. If I add a loop to do that twice it seems like the result are not printed out directly. Instead it puts it into the buffer until the loop/main are finished before...
Type: Posts; User: Hunter_wow
Thanks Salem! Just one more thing. If I add a loop to do that twice it seems like the result are not printed out directly. Instead it puts it into the buffer until the loop/main are finished before...
Hello again :D. I have restarted the problem but having a hard time getting it to work without the popen. It seems like wc gets the wrong result from ls,
Any ideas why?
//create a pipe
int...
Seems to work great. Thanks a lot mate. :D
I might be wrong but it looks to me that it would be executed as two separate commands by doing that way. Or?
"---- exec the 'wc' command"
will run and die before we go on to the
"---- exec the...
Seems nice. But I would prefer not to use scripting. Any hint on how it would look in C?
Yes. That is what I have tried to do. Have a working fork together with pipe to send the result from execvp to the parent process. But when I have executed "ls" for the first process I need to use...
Hi. I have problems with the execvp command. I would like to run multiple commands. For example:
Right now it works fine if I write:
har *argv[2] = {"ls",NULL};
execvp("ls", argv);
But how do...
Thanks a lot matsp. I removed the pointer and "new". But now I would like to run a method who is located into the source file of the Header file.
className::vname[0].methodName();
But getting...
Thanks. I will try to make it without "new" then. But this raise other errors.
I want to put my "className name;" into a vector created/declare into my Header file like this:
static...
Hello. I´m trying to make a new object into my main():
objectName name = new objectName();
Where "objectName" is a class into my Header file.
But I´m reciving the error:
Just one more small question: is it possible to get the x and y values from this?
Point foo = { 1, 2 };
list.push_back(foo);
// tried this but dosent seems to be the correct way
int x =...
Tons of thanks. That random_shuffle was very easy. Perfect for my purpose =)
Tons of thanks. Seems to work great =D
Point foo(1,2);
gives:
error C2078: too many initializers
error C2440: 'initializing' : cannot convert from 'int' to 'Point'
and
lista.push_back(Point(1, 2));
gives:
I´m sorry. I started with C++ very recently and dont know how to handle the typedef. Have tried all I can come up with but it still dosent work. What would you set "foo" to for example?
Just some...
Hello. I´m looking for a good way to make a array in random order. But I really cant come up with anything good. Thought of something like this(sorry if syntax is wrong, but I guess you can see what...
Hello. I would like to know how I set in Points(x,y) to a list. Like this:
#include <list>
//Defining point type
typedef struct Point{
int x, y;
}Point;