Seg fault on code that should work according to the professor [duplicate]

Problem is here.

a* = b*;  

Change this to a = b or *a = *b (depends on what you want to do, either pointer assignment or assignment of variables that pointer points to).

And

char* x = "blaahhhblah";  

should be

char x[] = "blaahhhblah";

Leave a Comment