Initializing it like that only works when you're declaring it

char addr[] = "Cane Gardens";

but not after.

For your case, you can copy a string in directly:

strcpy(account[0].address,"Cane Gardens");

Just remember there is a null character ('\0') at the end of "Cane Gardens," so make sure your address array is big enough to hold whatever you copy to it plus the null.

Thanks. Sinse its working now, I'll close thie thread

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.