c++ ->
struct car {
int year
int vin;
}
struct car myCar;
p_myCar = &myCar;
myCar.year = 1995;
// '->' allows you to use the '.' with pointers
p_myCar->vin = 1234567;
c++ ->
struct car {
int year
int vin;
}
struct car myCar;
p_myCar = &myCar;
myCar.year = 1995;
// '->' allows you to use the '.' with pointers
p_myCar->vin = 1234567;
? c++
The Conditional (or Ternary) Operator (?:)
(expression 1) ? expression 2 : expression 3
If expression 1 evaluates to true, then expression 2 is evaluated.
If expression 1 evaluates to false, then expression 3 is evaluated instead.
// ternary operator checks if
// marks is greater than 40
int marks = 50;
string result = (marks >= 40) ? "passed" : "failed";
// result = "passed"
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us