The idea is, from the entry of a pid by the user, stop it, but it is not working, do you have any ideas?
#include <stdio.h>
int main()
{
char proceso;
char command;
for(;;){
command="kill ";
printf( "Aca listo los procesos" );
fflush(stdout);
system("ps -eo user,pid,%mem,%cpu --width 9 --sort -rss | head");
fflush(stdout);
printf("Deme un pid para detener" );
fflush(stdout);
scanf("%s",&proceso);
printf( "deteniendo el proceso PID: %s\n", proceso );
fflush(stdout);
command=command+proceso;
printf( "El comando es: %s\n", command );
fflush(stdout);
int system(const char * command);
}
return 0;
}