IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesC++  Print This     

Case Sensitivity (C++ and PHP Cross Reference Guide)

By Mike Prestwood

C++ versus PHP: A side by side comparison between C++ and PHP.

 
Language Basics
 

Language basics is kind of a catch all for absolute beginner stuff. The items (common names) I chose for language basics is a bit random and include items like case sensitivity, commenting, declaring variables, etc.

Case Sensitivity

[Other Languages] 

Languages Focus

Case sensitiviy in this case is referring to commands and variable names. For example, are "printf" and "PrintF" equivalent? Are fullname and FullName equivalent? When you create commands, operations, methods, or variables should you worry about case?

C++:   Yes

C++ is case sensitive. In C and C++ commands and variable names are case sensitive.

Syntax Example:

The following first standard C++ snippet works:

printf("hello\n");
 
Printf("hello\n"); //>>>Does not work!
PHP:   Yes and No

PHP is case sensitive with variable names but not with commands. Although commands are case incenstive, I prefer to use all lowercase because it's easy to type and that's what I see most PHP coders doing and I see it on PHP.Net.

Syntax Example:

All of the following are equivalent:

echo "hello<br>";
ECHO "hello<br>";
Echo "hello<br>";
eCHo "hello<br>";

...but variables are case sensitive:

$fullname = "Mike Prestwood"; //These are two...
$FullName = "Wes Peterson";   //separate varialbes.












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]