how to overcome [Error] expected unqualified-id before '{' token ?

please help me my new user here i want to ask please answer yeah master
this is my code that i make

#include <iostream>
#include <cstdlib>
using namespace std;
int main();
{

char nama[5] ="Rully";
cout<<"Nama awal ="<<nama<<endl;
char *ptr;
ptr=nama;
*(ptr=3)='y';
cout<<"Nama menjadi ="nama<<endl;

}


nah when I want to compile and execute the program always appears warning "[Error] expected unqualified-id before '{' token"
that's why ..? I can not find the solution :(

please help me these masters make a task at school
You are missing << between "Nama menjadi =" and nama.
Correct would be cout<<"Nama menjadi =" << nama<<endl;
Topic archived. No new replies allowed.