hi,
i get an error - 'incompatible types in assignment'
for the following code

#include<stdio.h>
int main()
{
	char name[10];
	name="Hello";
	printf("%s",name);
}

Any help will be greatly appreciated...

Recommended Answers

All 2 Replies

You can't assign arrays.
Use strcpy() instead.

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.