Click here to Skip to main content
15,894,460 members
Articles / Programming Languages / C++

Windows Fortune Application

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
17 Apr 20023 min read 81.1K   1.2K   21  
This application will display a random fortune in the font and colors of your choice.
//
// GetFortune.h -	header for the Get Fortune functions
//
//	� Copyright 2002 by Rick York
//	This code may be freely distributed or modified but
//	this copyright message must remain unchanged.
//

#ifndef _GETFORTUNE_H
#define _GETFORTUNE_H
#else
#error repeated include of this file
#endif // _GETFORTUNE_H


#define MAX_FORTUNE_SIZE	1023


#ifndef MAX_FORTUNE_COUNT	// defined in code module only

typedef void *	FortuneInfo;

#endif // MAX_FORTUNE_COUNT

		// initialize fortunes

FortuneInfo *	InitFortunes( const char *filename );

		// terminate fortunes

int				TermFortunes( FortuneInfo *f );

		// gets a fortune message - returns length	

int				GetFortuneText( FortuneInfo *f, char *buffer );

		// gets a random fortune

char *			GetRandomFortune( FortuneInfo * f );

		// gets specified fortune

char *			GetSpecFortune( FortuneInfo *f, int index );

		// returns number of fortunes

int				GetFortuneCount( FortuneInfo *f );


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
I work on an industrial HPC project that can run on either the CPU or the GPU. I usually use which ever one has the most horsepower on a given machine. It's written with CUDA with very few ifdefs used. My company is quite large, in the top five in our industry in North America, and I work in a small group with just five programmers.

Comments and Discussions