As you will see I am not good in c programming, still learning but my WindowsDefender is yelling at me for compiling this code with MinGW from Codeblocks IDE.
#include <stdio.h>
#include <string.h>
int main(void){
char *strings[] = {"test", "test"};
char *newStr;
int i;
for(i=0;i<2;i++){
strcat(newStr, strings[i]);
printf("%s\n", newStr);
}
return 0;
}
Can you help me with that I don't know what this is about. This can't be a normal issue mh?
char *newStr
tochar newStr[10];
.char newStr[10];
is still UB. Need:char newStr[10] = { 0 };
to force a starting EOS in the string so the firststrcat
works correctly. Alternate: above thefor
do:newstr[0] = 0;
c
tag) will see their browser tab change. Or, on the page, it will show an alert phrase. So, this is quite common.