Corrected capitalization, corrected to American spellings and typos (#30685)
* Translate challenge subtitles and example challenge text to Spanish * Corrected errors in syntax and punctuation * Multiple corrections of it/s to its plus other grammar corrections * Correction and added paragraph to CSS Flex article * Corrected my own typo * Corrected capitalization, American spellings and typos
This commit is contained in:
@@ -150,7 +150,7 @@ double a[5], b[5]
|
||||
a = b;
|
||||
```
|
||||
You can **only** deal with the values in an array one by one. You **cannot assign all at once**, when you learn about pointers later, the reasons will be clear.
|
||||
>(Basically, the first element of an array points to a memory address, and the elements after that are the "houses" next to that first one. So technically an array is just it's first element's memory address. When you want to assign the second array the first array, you run into error due to differing types, or you are trying to change the second memory address of the first element in the second array.)
|
||||
>(Basically, the first element of an array points to a memory address, and the elements after that are the "houses" next to that first one. So technically an array is just its first element's memory address. When you want to assign the second array the first array, you run into error due to differing types, or you are trying to change the second memory address of the first element in the second array.)
|
||||
|
||||
- When you want to create an array, you have to either tell its size, or assign values to it. Do not do this:
|
||||
```C
|
||||
|
@@ -43,7 +43,7 @@ sizeof(int)
|
||||
```
|
||||
Let's start from `sizeof`. The `malloc` needs to know how much space allocate for your data. In fact a `int` variable will use less storage space then a `double` one.
|
||||
It is generally not safe to assume the size of any datatype. For example, even though most implementations of C and C++ on 32-bit systems define type int to be four octets, this size may change when code is ported to a different system, breaking the code.
|
||||
`sizeof` as it's name suggests generates the size of a variable or datatype.
|
||||
`sizeof` as its name suggests generates the size of a variable or datatype.
|
||||
|
||||
```C
|
||||
arrayPointer = (int*) malloc(sizeof(int) * arrayDimension);
|
||||
|
@@ -46,7 +46,7 @@ typedef struct{
|
||||
point image_dimension = {640,480};
|
||||
```
|
||||
|
||||
Or if you prefer to set it's values following a different order:
|
||||
Or if you prefer to set its values following a different order:
|
||||
|
||||
```C
|
||||
point img_dim = { .y = 480, .x = 640 };
|
||||
|
Reference in New Issue
Block a user