|
#ifndef __BRAINLESS_INTERFACE__
#define __BRAINLESS_INTERFACE__
/*
Author : Shakti Misra
All are welcome to use these files, distribute, modify and release. But This notice should be included.
This software is given as is, for use and modification.
*/
#include <stdio.h>
#include <stdarg.h>
#include "constNDefs.h"
#ifdef WINPLATFORM
#include <conio.h>
#endif
class IOInterface
{
public:
IOInterface(){}
~IOInterface(){}
int getChar()
#if !defined( WINPLATFORM )
{return getchar();}
#else
{return _getch();}
#endif
int putStringOnScreen(const char* str)
{return puts(str);}
int printToScreen(const char* str, ...)
{
int rcode = 0;
va_list argptr = {0};
va_start(argptr, str);
/*for now we know we only have 2 parameters, so no need to parse and know.*/
rcode = printf(str, va_arg(argptr, ulong), va_arg(argptr, char));
va_end(argptr);
return rcode;
}
};
#endif //__BRAINLESS_INTERFACE__
|
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.
I like to explore different aspects of technology. Try new things, and get delighted. My interests are programming language, and Imaging. But its not hard to work on other things also. Algorithms delight me over a coffee break.
I basically code in C++, but JAVA is not so alien for me. I know few scripting languages also. Basically I feel that knowing a programing language is just a matter of getting introduced to it.
For my other articles check my blog on homepage:
http://brainlesslabs.com/
https://github.com/BrainlessLabsInc
http://www.luxrender.net/en_GB/authors_contributors - SMISRA