Hello all..
I am making a code that prints random characters from the template.
Thing is.. I make a printf() and specify template[ch]. when 'template' is a char and 'ch' is an int to specify where in the char it will print.
But gcc does not look at template. it looks at 'ch' and thought it was int.
I don't know who's fault this is (gcc or me). Here is the code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char template[999] = "qwertyuiopasdfghjklzxcvbnm1234567890äåéëþüúíóö«»áßðø¶æ©®bñµç.¿¹²³¤^¥×¡,~_£¼½¾,~*÷ÄÅÉËÞÜÚÍÓÖÁ§ÐÏØÆ¢°®ÑµÇ";
int ch;
for (;;)
{
ch = rand() % strlen(template);
printf("%s", template[ch]);
fflush(stdout);
}
return 0;
}
I need it soon! THanks in advance.