How can i set the xcode 5 so that i can run c project like in the terminal
when i run a c project in the terminal like this :
#include <stdio.h>
int usr1 = 0, usr2 = 0;
void func(int);
void main1(int argc, const char * argv[])
{
signal(SIGUSR1, func);
signal(SIGUSR2, func);
for (; ; ) {
sleep(1);
}
}
void func(int sig)
{
if (sig == SIGUSR1) {
usr1++;
}
if (sig == SIGUSR2) {
usr2++;
}
fprintf(stderr, "SIGUSR1[%d]; SIGUSR2[%d]\n", usr1, usr2 );
signal(SIGUSR1, func);
signal(SIGUSR2, func);
}
int main(int argc, char * argv[])
{
main1(argc, argv[]);
return 0;
}
in the terminal i can compile like this : gcc -o test main.c
then i can run it in background like : ./test &
my question is :how can i set the xcode so that i can run this c project in background like the in the terminal?
OS X Mavericks (10.9.2)