Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- int main()
- {
- system("echo HAI");
- return 0;
- }
- #include <stdio.h>
- int main()
- {
- int entry = 1;
- char line[200];
- FILE* output = popen("/usr/bin/ls -1 /usr/man", "r");
- while ( fgets(line, 199, output) )
- {
- printf("%5d: %s", entry++, line);
- }
- }
- 1: cat1
- 2: cat1b
- 3: cat1c
- 4: cat1f
- 5: cat1m
- 6: cat1s
- ...
- int system(const char *string);
- QString program = "./yourspawnedprogram";
- QProcess * spawnedProcess = new QProcess(parent);
- spawnedProcess->start(program);
- // or spawnedProcess->startDetached(program);
- #include <unistd.h>
- #include <stdio.h>
- int main()
- {
- printf( "hi 2 un" );
- int mypid = fork();
- if( 0 == mypid )
- printf( "lol childn" );
- else
- printf( "lol parentn" );
- return( 0 );
- }
Add Comment
Please, Sign In to add comment