Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Solaris Dynamic Tracing Guide
Previous Next

Typedef

The typedef keyword is used to declare an identifier as an alias for an existing type. Like all D type declarations, the typedef keyword is used outside probe clauses in a declaration of the form:

typedef existing-type new-type ;

where existing-type is any type declaration and new-type is an identifier to be used as the alias for this type. For example, the declaration:

typedef unsigned char uint8_t;

is used internally by the D compiler to create the uint8_t type alias. Type aliases can be used anywhere that a normal type can be used, such as the type of a variable or associative array value or tuple member. You can also combine typedef with more elaborate declarations such as the definition of a new struct:

typedef struct foo {
    int x;
    int y;
} foo_t;

In this example, struct foo is defined as the same type as its alias, foo_t. Solaris C system headers often use the suffix _t to denote a typedef alias.

Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire