Initial commit
This commit is contained in:
BIN
ForNextDay/Lec2/Lec2 - forNextDay().pdf
Normal file
BIN
ForNextDay/Lec2/Lec2 - forNextDay().pdf
Normal file
Binary file not shown.
BIN
ForNextDay/Lec2/Lec2src.zip
Normal file
BIN
ForNextDay/Lec2/Lec2src.zip
Normal file
Binary file not shown.
BIN
ForNextDay/Lec2/Lec2src/Lec2src/first
Normal file
BIN
ForNextDay/Lec2/Lec2src/Lec2src/first
Normal file
Binary file not shown.
9
ForNextDay/Lec2/Lec2src/Lec2src/first.c
Normal file
9
ForNextDay/Lec2/Lec2src/Lec2src/first.c
Normal file
@ -0,0 +1,9 @@
|
||||
// first.c
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int main(int argc, char * * argv)
|
||||
{
|
||||
int a = 65;
|
||||
printf("d = %d, 4d = %4d, x = %x, o = %o, c = %c\n", a, a, a, a, (char)a);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
ForNextDay/Lec2/Lec2src/Lec2src/playStack
Normal file
BIN
ForNextDay/Lec2/Lec2src/Lec2src/playStack
Normal file
Binary file not shown.
50
ForNextDay/Lec2/Lec2src/Lec2src/playStack.c
Normal file
50
ForNextDay/Lec2/Lec2src/Lec2src/playStack.c
Normal file
@ -0,0 +1,50 @@
|
||||
// first.c
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define MAX 256
|
||||
#define PUSH 1
|
||||
#define POP 0
|
||||
#define LIST 2
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int stack[MAX];
|
||||
int size = 0;
|
||||
int val;
|
||||
int iChoice;
|
||||
int iNRead;
|
||||
|
||||
/* Processing loop */
|
||||
printf("Choice (1=add, 0=remove, 2=list): ");
|
||||
iNRead = scanf("%d", &iChoice);
|
||||
while(iNRead == 1)
|
||||
{
|
||||
switch(iChoice)
|
||||
{
|
||||
case PUSH:
|
||||
printf("Value to add: ");
|
||||
scanf("%d", &val);
|
||||
if (size < MAX) {
|
||||
stack[size] = val;
|
||||
size++;
|
||||
}
|
||||
break;
|
||||
case POP:
|
||||
// Print out the last element and remove it.
|
||||
if(size > 0) {
|
||||
size--;
|
||||
val = stack[size];
|
||||
printf("Element: %d Value: %d\n", size, val);
|
||||
}
|
||||
break;
|
||||
case LIST:
|
||||
// Print out the stack elements
|
||||
for(int i = 0; i < size; i++) {
|
||||
printf("Element %d: %d\n", i, stack[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
printf("Choice (1=add, 0=remove, 2=list): ");
|
||||
iNRead = scanf("%d", &iChoice);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
ForNextDay/Lec2/Lec2src/Lec2src/playStack.exe
Normal file
BIN
ForNextDay/Lec2/Lec2src/Lec2src/playStack.exe
Normal file
Binary file not shown.
BIN
ForNextDay/Lec2/Lec2src/Lec2src/sizeofExample
Normal file
BIN
ForNextDay/Lec2/Lec2src/Lec2src/sizeofExample
Normal file
Binary file not shown.
14
ForNextDay/Lec2/Lec2src/Lec2src/sizeofExample.c
Normal file
14
ForNextDay/Lec2/Lec2src/Lec2src/sizeofExample.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
char ch = 'a';
|
||||
int interger = 10;
|
||||
float fl = 10.0;
|
||||
double doub = 25.2525;
|
||||
int a = sizeof(ch);
|
||||
int b = sizeof(interger);
|
||||
int c = sizeof(fl);
|
||||
int d = sizeof(doub);
|
||||
printf("char = %d, int = %d, float = %d, double = %d\n", a, b, c, d);
|
||||
}
|
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 11-42-27.png
Normal file
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 11-42-27.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 12-44-07.png
Normal file
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 12-44-07.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 12-44-33.png
Normal file
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 12-44-33.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 12-45-12.png
Normal file
BIN
ForNextDay/Lec2/Lec2src/Screenshot from 2021-09-13 12-45-12.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
BIN
ForNextDay/Lec2/Shoebottom_Isaac_fND_2.docx
Normal file
BIN
ForNextDay/Lec2/Shoebottom_Isaac_fND_2.docx
Normal file
Binary file not shown.
Reference in New Issue
Block a user