C Exercise 95
100 Classic C Language Examples
**Problem:** A simple structure application example.
**Analysis:** None.
Program source code:
Example
// Created by www.runoob.com on 15/11/9.
// Copyright (c) 2015 Runoob Tutorial. All rights reserved.
//
#include
struct
programming
{
float
constant
;
char
pointer
;
}
;
int
main
(
)
{
struct
programming variable
;
char
string
[
]
=
"Runoob Tutorial:https://www.runoob.com"
;
variable.
constant
=
1.23
;
variable.
pointer
=
string
;
printf
(
"%f\n"
,
variable.
constant
)
;
printf
(
"%s\n"
,
variable.
pointer
)
;
return
0
;
}
The above example produces the following output:
1.230000
Runoob Tutorial:https://www.runoob.com