update
This commit is contained in:
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int i;
|
||||
int *ptr = &i;
|
||||
i = 1;
|
||||
printf("ptr = %p \n", ptr); // ptr = 0x7fffc953d9f4
|
||||
printf("*ptr = %d \n", *ptr); // *ptr = 1
|
||||
printf("i = %d \n", i);
|
||||
*ptr = 2;
|
||||
printf("i = %d \n", i);
|
||||
}
|
||||
Binary file not shown.
@@ -1,30 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int y;
|
||||
|
||||
int f(int param1, int param2){
|
||||
if (param2 == 0) {
|
||||
printf("Fehler: Division durch %d nicht möglich \n", param2);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
else {
|
||||
int res = (2*(param1*param1)) / param2;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
int main(){
|
||||
int x = 4;
|
||||
while (1) {
|
||||
scanf("%d", &y); // scanf erwartet Speicheradresse
|
||||
if (y != 0){
|
||||
break;
|
||||
}
|
||||
else {
|
||||
printf("Fehler: Division durch 0 nicht möglich \n");
|
||||
}
|
||||
}
|
||||
printf("%d \n",f(x,y));
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,15 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void swap(int *a1, int *a2){
|
||||
int s = *a1;
|
||||
*a1 = *a2;
|
||||
*a2 = s;
|
||||
}
|
||||
-
|
||||
int main() {
|
||||
int var1 = 4;
|
||||
int var2 = 5;
|
||||
printf("var1: %d, var2: %d \n", var1, var2);
|
||||
swap(&var1, &var2);
|
||||
printf("swapped var1: %d, swapped var2: %d \n", var1, var2);
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user