SQL Injection Explained
Learn how SQL Injection works with real examples and a hands-on demo using PHP and MySQL. Explore a GitHub repo with vulnerable code to safely test and understand this critical web vulnerability.
Strings are an essential part of programming and programming language. In C/C++, there are two ways to represent them: string literals and character arrays. In this blog, we will delve deep into the string literals and character arrays in C/C++.
Definition:
A string literal in C/C++ is a sequence of character enclosed in double quotation marks. For example:
// In C
char* strLiteral = "Hello, World!";
// In C++
const char* strLiteral = "Hello, World!";
Here, strLiteral is basically a pointer to the (const) string literal.
Characteristics:
\0
), marking the end of the string.Cons:
Example:
const char* greeting = "Hello";
Definition:
A character array in C/C++ is a sequence of characters stored in contiguous memory locations. It is declared as an array of characters and can be modified during program execution.
char charArray[] = "Hello, World!";
or
char charArray[size] = "Hello, World!";
Here, greeting
is a character array that can be modified.
Characteristics:
Cons:
And yet you incessantly stand on their slates, when the White Rabbit: it was YOUR table,' said.
Your email address will not be published. Required fields are marked *
Learn how SQL Injection works with real examples and a hands-on demo using PHP and MySQL. Explore a GitHub repo with vulnerable code to safely test and understand this critical web vulnerability.
Learn how CI/CD transforms software development by automating builds, tests, and deployments. Boost speed, reduce bugs, and release confidently with continuous integration and delivery.
Learn C memory management with clear examples of malloc, calloc, realloc, and free. Understand memory types, avoid common pitfalls, and optimize your C programs efficiently.