Hi,
Why can't I get static to work here? Where static is highlighted in blue.
Code:
#include <stdio.h>
main()
{
char source[] = "qazwsxedcrfvtgbyhnujmikolp";
char * src_ptr;
char target[] = "lkjhgfdsaqwertyuiopmnbvcxz";
char * tar_ptr;
char temp[51];
char * temp_ptr;
int counter=0,
i=0,
t=0;
printf("\nPlease enter a line of text: ");
gets(temp);
for(temp_ptr = temp; *temp_ptr != '\0'; ++temp_ptr)
++t;
while(i<t)
{
for(src_ptr = source, static temp_ptr = temp; *temp_ptr && *src_ptr != '\0';)
{
if(*temp_ptr != *src_ptr)
{
++src_ptr;
continue;
}
else
{
++temp_ptr;
break;
}
}
++i;
}
getchar();
}