please could someone detect some kind of error in the code, because it never enters the loop for, because it doesnt printf, since i cant find the error, i was hoping someone could help me.
PHP Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAXLINE 1024
char *res
char line[MAXLINE]="blabla = job";
char *vchar;
int k,n;
vchar=(char)malloc((sizeof (char))*100);
res=fopen(argv[2], "r+");
for(k=0, n=0; line[k]!='\0'; k++,n++ )
{
printf("this is the loop");
if ((line[k]>='a' && line[k]<='z') ||(line[k]>='A' && line[k]<='Z'))
{
line[k]=vchar[n];
printf("IF 1\n");
}
else
{
if((line[k]>='a' && line[k]<='z') ||(line[k]>='A' && line[k]<='Z'))
{
printf("IF 2\n");
vchar[k]='\0';
if(strstr(name,vchar))
{
printf("YET another IF\n");
fprintf(res,"%s",corpo);
}
else
{
vchar[n]='\0';
fprintf(res,"%s",vchar);
}
}
}