Mini Help
#1

hey all i have just scripted a simple script for my server but after compiling it i found a error and i have tried serveral times to fix it but i can't please help.

Code:
new symbols[20][] = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+', '=', '~', '`', '/', '\', '.', '|', '?'};
error:
Code:
error 027: invalid character constant
Reply
#2

You can't use \ just like that use \\ also no need of 2d array its just plane set of characters.Use this
PHP Code:
new symbols[]= {'!''@''#''$''%''^''&''*''('')''-''+''=''~''`''/''\\''.''|''?'}; 
Reply
#3

Quote:
Originally Posted by Sreyas
View Post
You can't use \ just like that use \\ also no need of 2d array its just plane set of characters.Use this
PHP Code:
new symbols[]= {'!''@''#''$''%''^''&''*''('')''-''+''=''~''`''/''\\''.''|''?'}; 
thanks dude for your help but i have one question why should i use \\ not \ ?
Reply
#4

Because it is escape sequence which are used to represent special characters in strings and character literals.To represent \ we should ,therefore, use \\
Reply
#5

Quote:
Originally Posted by Sreyas
View Post
Because it is escape sequence which are used to represent special characters in strings and character literals.To represent \ we should ,therefore, use \\
okay thanks so much
+repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)