Exemple C Exercice 95
100 cas de la langue classique C
Titre: exemples d'application de structure simple.
Analyse du programme:Aucun.
Source Code:
// Created by www.w3big.com on 15/11/9. // Copyright © 2015年 本教程. All rights reserved. // #include <stdio.h> struct programming { float constant; char *pointer; }; int main() { struct programming variable; char string[] = "本教程:http://www.w3big.com"; variable.constant = 1.23; variable.pointer = string; printf("%f\n", variable.constant); printf("%s\n", variable.pointer); return 0; }
Exécutez l'exemple ci-dessus est sortie:
1.230000 本教程:http://www.w3big.com