C# prefixing parameter names with @ [duplicate]

Try and make a variable named class and see what happens — You’ll notice you get an error.

This lets you used reserved words as variable names.

Unrelated, you’ll also notice strings prefixed with @ as well — This isn’t the same thing…

string says = @"He said ""This literal string lets me use \ normally 
    and even line breaks"".";

This allows you to use ‘literal’ value of the string, meaning you can have new lines or characters without escapes, etc…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)