![]() |
|
#1
|
||||
|
||||
|
Hallo zusammen! (=
Speziell die Programmierer müssen mir kurz helfen. Hab spontan im Studium ein Aufgabenblatt bekommen, welches sich mit Zeigern in C beschäftigt. Jetzt hab ich mich leider seit Jahren nicht mehr damit auseinandergesetzt. Daher würde es mich riesig freuen, wenn ihr mir bei den 3 Aufgaben kurz helfen könntet. (= Aufgabe 1 Bitte ermitteln Sie für folgendes Programm die Ausgaben. Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char *args[])
{
int i, j;
int *p1, *p2, **p3;
p1 = &i;
p2 = &j;
*p1 = 3;
*p2 = 5;
printf ("p1p2 ist %d\n", *p1 * *p2);
p3 = &p1;
**p3 = 7;
printf ("p1p2p3 ist %d\n", *p1 * *p2* **p3);
system ("PAUSE");
return EXIT_SUCCESS;
}
Bitte ermitteln Sie für folgendes Programm die Ausgaben. Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char *args[])
{
int i=0, j=0;
int *p1=&j, *p2=&i;
while (*p2 <= 10) {
*p1 = *p1 + *p2;
*p2 = 1 + *p2;
}
printf ("p1 ist %d\n", *p1);
printf ("p2 ist %d\n", *p2);
for (/* EMPTY! */ ; *p2 > 0; *p2 = *p2-1) {
*p1 = *p1 + *p2;
}
printf ("p1 ist %d\n", *p1);
printf ("p2 ist %d\n", *p2);
system ("PAUSE");
return EXIT_SUCCESS;
}
Bitte ermitteln Sie für folgendes Programm die Ausgaben. Code:
#include <stdio.h>
#include <stdlib.h>
void F (int *t, int *s, int *x)
{
if (*s == 0) {
*t = 1;
}
if (*s > 0) {
*s = *s - 1;
F (t, s, x);
*t = *t * *s;
}
*x = *x + 1;
}
int main(int argc, const char *args[])
{
int i = 0, j = 3, k = 0;
F (&i, &j, &k);
printf ("i ist %d\n", i);
printf ("j ist %d\n", j);
printf ("k ist %d\n", k);
system ("PAUSE");
return EXIT_SUCCESS;
}
__________________
"Ich, der verrückte Rätsler, habe Captain Girl gepenist, weil die penible Peniskuh zu schwanz an meiner Genitalität interpenissiert war." - Captain Hero Geändert von Localhorst (22.06.2012 um 20:20 Uhr). Grund: added code blocks |
|
#2
|
||||
|
||||
|
*i have no idea what i am doing*
__________________
und die vergleiche werden immer immer doller,
weit hergeholt wie die kinder von madonna. |
|
#3
|
||||
|
||||
|
__________________
RAID 0 has redundancy, but the other way round: If some of the disks non-fail, that non-failure can still be worked around by another disk failing. Indeed, it has very high reverse redundancy: Even if all but 1 disks non-fail, the one failure still ensures complete failure of the array. The more disks you use, the better you are protected against non-failure. |
|
#4
|
||||
|
||||
|
Local du bist mein Held! Bei der nächsten Fogel-Con knabber ich dir, auf Wunsch, an deinen Nippeln herum! <3 <3 <3
Ich hätte die Kacke ja auch selbst durch den Compiler jagen können.. nur besitze ich keinen mehr seit mir meine SSD abgeschmiert ist .______.
__________________
"Ich, der verrückte Rätsler, habe Captain Girl gepenist, weil die penible Peniskuh zu schwanz an meiner Genitalität interpenissiert war." - Captain Hero |
|
#5
|
||||
|
||||
|
Code:
[ ] Ich kenne den Knopf in der Werkzeugleiste, um einen Codeabschnitt einzufügen.
__________________
“I keep two magnums in my desk. One’s a gun and I keep it loaded. The other’s a bottle and it keeps me loaded.” |
|
#6
|
||||
|
||||
|
Zitat:
Zitat:
beautiful <3
__________________
RAID 0 has redundancy, but the other way round: If some of the disks non-fail, that non-failure can still be worked around by another disk failing. Indeed, it has very high reverse redundancy: Even if all but 1 disks non-fail, the one failure still ensures complete failure of the array. The more disks you use, the better you are protected against non-failure. Geändert von Localhorst (22.06.2012 um 20:55 Uhr). |
|
#7
|
||||
|
||||
|
Oh noes! =(
Gut zu wissen. Danke für den Tipp! (=
__________________
"Ich, der verrückte Rätsler, habe Captain Girl gepenist, weil die penible Peniskuh zu schwanz an meiner Genitalität interpenissiert war." - Captain Hero |