rudra <bnrj.rudra@gmail.comwrites:
Quote:
plz forgive me to put a C problem here; but the point is general!
i have written a code::
#include <stdio.h>
#include <stdlib.h>
|
#include <cstdio>
#include <cstdlib>
Quote:
int main()
{
int sys;
int i686;
sys=system("/bin/uname -m");
//printf ("%d",sys);
if (sys==i686){
|
What are you comparing here? The i686 variable hasn't been initialized
to anything.
Quote:
printf("the syst. 32 bit");
}
else
printf("64but");
}
where i want the output of "system("/bin/uname -m")" as the variable
sys.....to find the machine structure.this procedure is not quite
working.
|
Not working, or not doing what you expect? System() is supposed to
return the called app's exit code. If /bin/uname is successfully
launched and doesn't crash, that should be 0.
Quote:
|
can you people suggest me some way?
|
I tried to find a standards-based solution to this, but for the life
of me I couldn't find a C++ streams equivalent to C's popen()
function. The closest I could find was to construct a Boost.Iostream
with a file descriptor opened with popen().
Did I miss something?
sherm--
--
My blog:
http://shermspace.blogspot.com
Cocoa programming in Perl:
http://camelbones.sourceforge.net