In my book there is an example how to copy a character string (2 pointers). I copied the whole code but when I start the program in terminal it says "Segmentation fault (core dumped)" >.<
What is wrong with this code? :
#include <iostream>
#include <string>
using namespace std;
void cpy(char* p,const char* q){
while(*p++ = *q++) ;
}
int main(){
char* hello;
cpy(hello, "Whazzap");
return 0;
}