Final for C

This commit is contained in:
Ajay T Shaju
2023-09-18 22:36:03 +05:30
parent 8e3299d2df
commit 984b1b0282
2 changed files with 5 additions and 72 deletions

View File

@@ -158,9 +158,9 @@ In Linux systems:
| `!=` | Not equal, result is true or false, `a != b` |
| `&` | Bitwise and, `a & b` |
| `^` | Bitwise exclusive or, `a ^ b` |
| | | Bitwise or, `a | b` |
| | | Bitwise or, `a` | `b` |
| `&&` | Relational and, result is true or false, `a < b && c >= d` |
| &#124; &#124; | Relational or, result is true or false, `a < b || c >= d` |
| &#124; &#124; | Relational or, result is true or false, `a < b` &#124; &#124; `c >= d` |
| `?` | Ternary conditional, `exp1 ? exp2 : exp3`, result is `exp2` if `exp1` is not 0, else result is `exp3` |
| `=` | Store |
| `+=` | Add and store |
@@ -191,11 +191,11 @@ In Linux systems:
| LR | `==`, `!=` |
| LR | `&` |
| LR | `^` |
| LR | `|` |
| LR | &#124; |
| LR | `&&` |
| LR | `||` |
| LR | &#124; &#124; |
| RL | `? :` |
| RL | `=`, `+=`, `-=` ,`*=`, `/=`, `%=`, `>>=`, `<<=`, `&=`, `^=`, `|=` |
| RL | `=`, `+=`, `-=` ,`*=`, `/=`, `%=`, `>>=`, `<<=`, `&=`, `^=`, &#124;= |
| LR | `,` |
@@ -229,6 +229,4 @@ In Linux systems:
statement_sequence /* the expression. This is optional */
}
---
---

View File

@@ -1,65 +0,0 @@
Operator precedence
More precedence
LR ( ) [ ] -> . x++ x--
RL ! ~ - + ++x --x * & sizeof (type)
LR * / %
LR + -
LR << >>
LR < <= > >=
LR == !=
LR &
LR ^
LR |
LR &&
LR ||
RL ? :
RL = += -= *= /= %= >>= <<= &= ^= |=
LR ,
Less precedence
Function definition
type function_name(int a, float b, const char * ch,...) { function_body }
/* only parameters passed by address can are modified*/
/* in the calling function, local copy can be modified*/
char * strcpy( char * s1, const char * s2 ) { statements }
Declarations forms
basic_type variable;
type variable[val][val]...[val]={data,data,...}; /*multidimensional array*/
struct struct_name { /* struct_name is optional */
type variable_1; /* any declaration */
… /* all variable names must be unique*/
} variable_1, ... ; /* variables are optional */
struct struct_name { /* struct_name is optional */
type variable_1: length; /* any declaration : length in bits */
... /* type is int, unsigned or signed */
} variable_1, ... ; /* variables are optional, they can also be arrays and pointers */
union union_name { /* union_name is optional */
type variable_1; /* variable_1 overlays variable_2 */
type variable_2;
...
} variable_a, ...; /* variables are optional */
enum enum_type /* enum_name is optional */
{ enumeration_name_1, /* establishes enumeration literals */
enumeration_name_2=number,/* optional number, */
... /* default is 0, 1, 2, ... */
} variable, ...; /* variables are optional */
/* use dot notation to select a component of a struct or union */