This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:c4eng:fall2023:projects:dtr0 [2023/09/12 22:39] – [PROGRAM SPECIFICATIONS] mwinter4 | notes:c4eng:fall2023:projects:dtr0 [2023/09/14 00:42] (current) – [DATA TYPES IN C] lbond1 | ||
---|---|---|---|
Line 40: | Line 40: | ||
**Signed int**- This type of data occupies 2 or 4 bytes of memory (16 or 32 bits) depending on the compiler and allows expressing a maximum of 65,536 at 2 bytes or 4, | **Signed int**- This type of data occupies 2 or 4 bytes of memory (16 or 32 bits) depending on the compiler and allows expressing a maximum of 65,536 at 2 bytes or 4, | ||
- | **Unsigned int**- This type of data occupies 2 or 4 bytes of memory (16 or 32 bits) depending on the compiler and allows expressing a maximum of 65,536 at 2 bytes or 4, | + | **Unsigned int**- This type of data occupies 2 or 4 bytes of memory (16 or 32 bits) depending on the compiler and allows expressing a maximum of 65,536 at 2 bytes or 4, |
- | **Signed long int**- This type of data occupies 4 or 8 bytes (32 or 64 bits) depending on the compiler and allows expressing a maximum of 4, | + | **Signed long int**- This type of data occupies 4 or 8 bytes (32 or 64 bits) depending on the compiler and allows expressing a maximum of 4, |
- | **Unsigned | + | **Unsigned long int**- This type of data occupies 4 or 8 bytes (32 or 64 bits) depending on the compiler and allows expressing a maximum of 4,294,967,295 at 4 bytes or 18, |
+ | **Signed long long int**- This type of data occupies 2,4 or 8 bytes of memory (16,32 or 64 bits) depending on the compiler and allows expressing a maximum of 65,536 at 2 bytes, 4, | ||
+ | |||
+ | |||
+ | **Unsigned long long int**- This type of data occupies 2,4 or 8 bytes of memory (16,32 or 64 bits) depending on the compiler and allows expressing a maximum of 65,536 at 2 bytes, 4, | ||
+ | Due to the limitations of our Pi's and compiler, the max bit count should be 32, this will mean that un/signed long long and un/signed long types will share values | ||
========COMPILE CODE========= | ========COMPILE CODE========= | ||
Line 74: | Line 79: | ||
**%hu** - Specifies the output type as half of an unsigned int (4/2 =2 bytes) | **%hu** - Specifies the output type as half of an unsigned int (4/2 =2 bytes) | ||
+ | |||
+ | **%u** | ||
+ | |||
+ | **%d** | ||
**%lld**- Specifies the output type as a signed long long int | **%lld**- Specifies the output type as a signed long long int | ||
Line 80: | Line 89: | ||
**%p**- Specifies the output type as an address in hexadecimal digits | **%p**- Specifies the output type as an address in hexadecimal digits | ||
+ | |||
+ | Essentially, | ||
=====PROGRAM SPECIFICATIONS===== | =====PROGRAM SPECIFICATIONS===== | ||
- | Within <wrap hi> | + | Within <wrap hi> |
- | These sections will contain multiple print statements to display information and formatting. They will also contain some computations for determining some of the information that will be printed to the screen. For example, take the following statement: | + | These sections, when completed, |
< | < | ||
Line 91: | Line 102: | ||
This statement informs us of the possible distinct values, which we will need for our output. | This statement informs us of the possible distinct values, which we will need for our output. | ||
+ | |||
+ | To get an idea of what your output should look like for each section, you can compile and run the program before even making any modifications. Notice that there is formatting to align the information in the right " | ||
------- | ------- | ||
If you are leaving nano use this command to save, if you don't you will get a save file every time you return to lab46. | If you are leaving nano use this command to save, if you don't you will get a save file every time you return to lab46. | ||
< | < | ||
+ | |||
+ | =====Submit===== | ||
+ | Once your program is complete you will need to submit all your files. | ||
+ | < | ||
+ | cd src/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | Once you are in the directory, use " | ||
+ | < | ||
+ | submit DESIG PROJECT File1 File2 File3 ... FileN | ||
+ | </ | ||
+ |