   itoa and SDL TTF
  Hey guys,I'm having a problem with writing text to my SDL screen. I'm working on a small game right now, the problem is that it's a winmain windowed screen so the console is disabled and I'm not sure how to enable it (setting subsystem to console screws up linkers) So I started looking for another way to print strings to my screen and I found SDL_TTF which I got to work when I directly give a char variable a value like char fps = "100";I actually made a fps counter in my program, the problem is that when I use itoa or sprintf to get the value of the integer 'framerate' in my string 'fps', my program crashes when I start it (there are no build errors though).This is the error I'm getting:itoa(framerate,fps,10);That's where it goes wrong, framerate is my integer storing the amount of frames since the last second, and fps is my char. I declared fps asstatic char *fps= "10000";so I tihnk i has something to do with allocation size and the pointer, but I always get confused when it gets to pointers and I'm a newbie to programming so help is greatly appreciated.I would paste a block of my code but my project too big to post and I don't know how else to post it, sorry :X   
  Your variable fps have the wrong type.For an example how to use itoa look here.   ;  I'm using it as an char, and it is also used like that in the example, so I don't know whats wrong.   ;  In the code:  static char *fps= "10000"; and char fps = "100";fps is a pointer to write-protected memory (the string "10000" and "100" respectively).  Writing to any write-protected memory is bad mojo, and therefore the exception.  Instead, you'll have to create a temporary buffer on the stack:In C:char buffer[64];sprintf( buffer, "%i", fps );/* use buffer *//* or */char buffer[64];itoa( fps, buffer, 10 );/* use buffer */In C++:// include <sstream>// include <string>std::stringstream ss;ss << fps;// use ss.str();Also, you can use [source][/source] tags to post large blocks of code, or you can use http://gamedev.pastebin.com/;  Thanks for all the feedback guys but I still can't get it to work.Sorry if I haven't been clear, here's what I want to do:I want to use this function:TTF_RenderText_Solid(TTF_Font *font, const char *text, SDL_Color fg)I have the Font and Color working, the thing I'm failing badly at is getting my framerate integer into a char and making that char a *char. I'm really bad at the pointer and arrays thing and the C++ tutorial website isn't really helping on that, can anyone recommend a good tut or explanation on it?;  Do you think you can post your codeand any error messages you're getting ?From the top of my head this should work:int fps = 1000;char buffer[ 20 ];itoa( fps, buffer, 10 );TTF_RenderText_Solid( font, buffer, fg ); // not sure about them font and fg thoughI'm not sure myself what the exactdifference is between c arrays andpointers except how you declare them.The above code could also be writtenlike this, although in this case it'squite unnecessary:int fps = 1000;char *buffer = malloc( 20 * sizeof( char ) );if( buffer == NULL ) // Out of memory, couldn't allocate the buffer  quit_the_program_gracefully(); itoa( fps, buffer, 10 );TTF_RenderText_Solid( font, buffer, fg );free( buffer );A google for c pointer tutorial gives someinteresting reading material.   ;  Thanks Pzc, that's exactly what I did but that gives me the exception error. I already found a way to enable the console so that's what im printing the fps to now an it works like a charm.   