printf not working for %s const char July 13, 2011 05:37PM | Registered: 13 years ago Posts: 363 |
engine_console() Object3D_LoadModel( "model/sspaceship01.obj", "model/sspaceship01.png", 2 );
Re: printf not working for %s const char July 13, 2011 07:24PM | Registered: 13 years ago Posts: 99 |
Object3D_LoadModel(const char *fn, const char * fn2, int p )
Object3D_LoadModel( Text1, Text2, 2 ); // or another way to do the same thing ... Object3D_LoadModel( &Text1[0], &Text2[0], 2 );
Re: printf not working for %s const char July 13, 2011 08:04PM | Registered: 13 years ago Posts: 363 |
Re: printf not working for %s const char July 14, 2011 01:53AM | Registered: 13 years ago Posts: 363 |
Re: printf not working for %s const char July 14, 2011 09:31AM | Registered: 13 years ago Posts: 99 |
char *MystringPointer = "Test123"; printf( MystringPointer ); printf( "message is %s", MystringPointer );
Re: printf not working for %s const char July 14, 2011 03:46PM | Registered: 13 years ago Posts: 363 |
Re: printf not working for %s const char July 14, 2011 09:36PM | Registered: 13 years ago Posts: 99 |
// Found some old code of mine on my backup drive, nasty hard coded numbers so look out. // TracePrintf("My message is: %d %s", 16386, "is a number") ; #include#include #include TracePrintf ( char* Format, ... ) { va_list ArgList; char Str[512]; FILE* file; static int FirstTime = 1; if ( FirstTime ) file = fopen ( "trace.log", "wt" ); else file = fopen ( "trace.log", "at" ); if ( file == NULL ) return; FirstTime = 0; va_start ( ArgList, Format ); _vbprintf ( Str, sizeof(Str), Format, ArgList ); va_end ( ArgList ); fprintf ( file, "Message: %s(%d): %s\n", DebugFile, DebugLine, Str ); fflush ( file ); fclose ( file ); }
Re: printf not working for %s const char July 14, 2011 09:41PM | Registered: 13 years ago Posts: 99 |
Re: printf not working for %s const char July 14, 2011 11:42PM | Registered: 13 years ago Posts: 363 |
Re: printf not working for %s const char July 15, 2011 02:48PM | Registered: 13 years ago Posts: 363 |
Re: printf not working for %s const char July 15, 2011 06:48PM | Registered: 15 years ago Posts: 686 |
Re: printf not working for %s const char July 15, 2011 07:20PM | Registered: 13 years ago Posts: 99 |
void MyPrintf(char* pText) { printf("Message is %s",pText); } // Call it just before start of the while loop MyPrintf("Testing123");
Re: printf not working for %s const char July 25, 2011 06:50PM | Registered: 13 years ago Posts: 363 |