![background image](http://html1.mh-extra.com/html/advantech/ubiq/ubiq_user-manual_2856809051.webp)
45
UbiQ Scenario Manager User Manual
Chapter 4
B
asic of
Smart-C
S
cript
Language
4.3
Declarations and Types
This section describes the declaration and initialization of variables, functions, and
types. The C language includes a standard set of basic data types. The following top-
ics are discussed:
Overview of declarations
Type specifiers
4.3.1
Overview of declarations
A “declaration” specifies the interpretation and attributes of a identifier. A declaration
that also causes storage to be reserved for the object or function named by the iden-
tifier is called a “definition.” C declarations for variables, functions, and types have
this syntax:
Syntax
declaration :
type_specifiers declarator ;
Declarations are made up of some combination of type specifiers and declarators.
In the general form of a variable declaration, type-specifier gives the data type of the
variable. The declarator gives the name of the variable, possibly modified to declare
an array. For example,
int fp[20];
declares a variable named fp as a 20-index array to int value.
A declaration must have one declarator. Declarators provide any remaining informa-
tion about an identifier. A declarator is an identifier that can be modified with brackets
([ ]), or parentheses ( ( ) ) to declare an array, or function type, respectively. When
you declare simple variables (such as character, integer, and floating-point items),
the declarator is just an identifier.
4.3.2
Type specifiers
Type specifiers in declarations define the type of a variable or function declaration.
Syntax
type-specifier :
void
char
int
double
string
variant
The keyword void specify a function return type. You can use the void type to declare
functions that return no value.
Summary of Contents for UbiQ
Page 1: ...User Manual UbiQ Scenario Manager User Manual V1 03...
Page 4: ...UbiQ Scenario Manager User Manual iv...
Page 7: ...Chapter 1 1 Introduction...
Page 13: ...Chapter 2 2 Getting Started...
Page 37: ...Chapter 3 3 Tutorials...
Page 47: ...Chapter 4 4 Basic of Smart C Script Language...
Page 62: ...UbiQ Scenario Manager User Manual 56...