008
30.10.2004, 20:21 Uhr
0xdeadbeef
Gott (Operator)
|
In C:
C++: |
#include <stdio.h>
/* ... */
char my_string[256]; int screen_width = 1024, screen_height = 768, screen_depth = 24;
snprintf(my_string, 256, "Momentane Auflösung %d*%d, %d Bit @ 60Hz", screen_width, screen_height, screen_depth); MessageBox(NULL, my_string, "INFO!!!", MB_OK | MB_ICONSTOP);
|
In C++:
C++: |
#include <sstream> #include <string>
using namespace std;
/* ... */
int screen_width = 1024, screen_height = 768, screen_depth = 24; std::stringstream sstr;
sstr << "Momentane Auflösung " << screen_width << "*" << screen_height << ", " << screen_depth << " Bit @ 60Hz"; MessageBox(NULL, sstr.str().c_str(), "INFO!!!", MB_OK | MB_ICONSTOP);
|
-- Einfachheit ist Voraussetzung für Zuverlässigkeit. -- Edsger Wybe Dijkstra |