Hey, Is there any difference between the 2 syntax,
ie, str = "This is a test"; and strcpy(str,"This is a test");
I think, both of them, malloc some random 200 addresses, and give the starting location of the 200 chunk to the pointer variable 'ptr'.
#include<stdio.h>
char* str;
int main(void)
{
str = (char*)malloc(200 * sizeof(char));
//str = "This is a test";
strcpy(str,"This is a test");
printf("\nAddress = %u",str);
printf("\nContents = %s",str);
return 0;
}