C Exercise Example 95
Title:A simple struct application example.
Program analysis:None.
Program source code:
Example
// Created by www.example.com on 15/11/9.
// Copyright © 2015 Example Tutorial. All rights reserved.
//
#include <stdio.h>
struct programming
{
float constant;
char *pointer;
};
int main()
{
struct programming variable;
char string[] = "Example Tutorial: https://www.example.com";
variable.constant = 1.23;
variable.pointer = string;
printf("%f\n", variable.constant);
printf("%s\n", variable.pointer);
return 0;
}
// Copyright © 2015 Example Tutorial. All rights reserved.
//
#include <stdio.h>
struct programming
{
float constant;
char *pointer;
};
int main()
{
struct programming variable;
char string[] = "Example Tutorial: https://www.example.com";
variable.constant = 1.23;
variable.pointer = string;
printf("%f\n", variable.constant);
printf("%s\n", variable.pointer);
return 0;
}
The output of the above example is:
1.230000 Example:https://www.example.comother extensions