I am doing a program that until the user type +, the typed string will be copied to another, for example stack +, the copied string would only stack, I tried to make the code below only that did not work.
#include <stdio.h>
int main(int argc, char** argv)
{
char nome[100], num1[100];
int cont,i;
scanf("%s", nome);
cont = 0;
for(i = 0; i < nome[i] != '+'; i++)
{
num1[cont] = nome[i];
}
num1[cont] = '#include <stdio.h>
int main(int argc, char** argv)
{
char nome[100], num1[100];
int cont,i;
scanf("%s", nome);
cont = 0;
for(i = 0; i < nome[i] != '+'; i++)
{
num1[cont] = nome[i];
}
num1[cont] = '%pre%';
printf("%d\n", cont);
return 0;
}
';
printf("%d\n", cont);
return 0;
}