-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
- - ----- Original Message -----
From: "Daniel Feist"
To:
Sent: Sunday, May 18, 2003 1:31 PM
Subject: C-Adressoperator
Hallo,
Ich habe eine Frage zum Adressoperator in C.:
Beispiel:
#include /* Bibliothek einbinden */
int main()
{
int i; /* Variable "i" festlegen */
printf("Bitte geben sie eine Zahl ein: ");
scanf("%d", &i); /* Standarteingebe stdin
mit "%d" festlegen und Variabele &i als Adressoperator bestimmen */
printf("Die Zahl, die sie eingegeben haben ist: "%d", i); /* Ich
verstehe
nicht, warum statt '&i' nur 'i' dasteht, obwohl der die
Standarteingabe
noch in "&i" abgeleg ist.
return 0;
}
Es wäre sehr nett von euch, wenn ihr mir ein bisschen unter die Arme
greifen könntet - Vielen Dank - Daniel
Gruss Daniel
--
clusterix.perl@gmx.de
Hallo Daniel.
Wenn du mit scanf irgendetwas vom keyboard abfragst dann muss dass
immer
scanf("%d, &i);
heißen.
Dass & ist nur dazu da, dass scanf die Eingabe richtig speichert.
Du must also das & ignorieren um den Variablennamen zu erhalten.
Viel Spaß beim hacken!
Mfg Skyman
PS: lies doch mal C für Dummies
(http://www.c-for-dummies.com)
hacking is not a crime!
(18C3)
https://www.ccc.de
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com
iQA/AwUBPspUtvTVWVnEIMgHEQKwNQCgyGRk4RN+OUaPEi1DaAIGHz9XcFYAoNed
NPQurYbU0Ss3zsbrx4NqeoRK
=C8nO
-----END PGP SIGNATURE-----