Your warning means that you don't have c++11 enabled in your compiler. What compiler are you using? Most now days support c++11 but some require you to turn it on.
The compiler is giving you that warning because of this char newname[]={"NONAME"}.
As for bad habits your indentation is kind of wierd in my opinion but that is a personal choice I guess so just keep it consistent (Indent your if statements).