Thu Nov 13, 2008 2:45 pm
/* C typedef assigns a name to a type. Its syntax can be really awful. */
#include <stdio.h>
/* Make fred an alias for the type name integer. */
typedef int fred;
/* Assign a type name to an enumeration. */
typedef enum { Sun, Mon, Tue, Wed, Thu, Fri, Sat} day;
int main()
{
fred m = 5;
day today = Fri;
if(today == m) printf("Yes!\n");
else printf("Nope.\n");
}
|
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.