Click here to Skip to main content
15,926,857 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Menu bar problem Pin
KarstenK23-Jan-08 1:16
mveKarstenK23-Jan-08 1:16 
GeneralRe: Menu bar problem Pin
Nitheesh George23-Jan-08 23:05
Nitheesh George23-Jan-08 23:05 
QuestionATL CImage class issue Pin
Antonyemac22-Jan-08 22:30
Antonyemac22-Jan-08 22:30 
GeneralRe: ATL CImage class issue Pin
Mark Salsbery23-Jan-08 6:42
Mark Salsbery23-Jan-08 6:42 
Questionhow to save a file? Pin
gentleguy22-Jan-08 22:27
gentleguy22-Jan-08 22:27 
AnswerRe: how to save a file? Pin
CPallini22-Jan-08 22:58
mveCPallini22-Jan-08 22:58 
GeneralRe: how to save a file? Pin
gentleguy23-Jan-08 1:32
gentleguy23-Jan-08 1:32 
GeneralRe: how to save a file? Pin
CPallini23-Jan-08 2:10
mveCPallini23-Jan-08 2:10 
To write some data to the file, the ostream object needs to know
(1) the address of the data.
(2) the size of the data.

(1) Well, &count means exactly the address of the variable count (as int pointer) and (char *) is a cast of the int pointer to a char one (ostream works on byte basis and it requires a char pointer, a char is 1-byte long, after all...).
(2) sizeof(count) is the size of count, i.e. the size of an integer variable (i.e. 4 bytes).


li zhiyuan wrote:
second question is that can you provide me the stuff: for example: %d,if%, and so forth



%d, %f are format specifiers for the printf (as well for fprintf, fscanf functions): whenever you need to print a particular type using such function(s) then you have to use the proper format specifier, for instance
int i= 100;
float f = 3.14159;
printf("An integer, i=%d, a float f=%f\n", i, f);

Full documentation can be found here http://msdn2.microsoft.com/en-us/library/hf4y5e3w(VS.71).aspx[^]
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


GeneralRe: how to save a file? Pin
gentleguy23-Jan-08 2:16
gentleguy23-Jan-08 2:16 
GeneralRe: how to save a file? Pin
CPallini23-Jan-08 2:20
mveCPallini23-Jan-08 2:20 
GeneralRe: how to save a file? Pin
gentleguy23-Jan-08 19:46
gentleguy23-Jan-08 19:46 
GeneralRe: how to save a file? Pin
CPallini23-Jan-08 21:04
mveCPallini23-Jan-08 21:04 
GeneralRe: how to save a file? Pin
gentleguy23-Jan-08 21:05
gentleguy23-Jan-08 21:05 
QuestionRe: how to save a file? Pin
CPallini23-Jan-08 21:12
mveCPallini23-Jan-08 21:12 
GeneralRe: how to save a file? Pin
gentleguy24-Jan-08 0:22
gentleguy24-Jan-08 0:22 
GeneralRe: how to save a file? Pin
CPallini24-Jan-08 0:49
mveCPallini24-Jan-08 0:49 
GeneralRe: how to save a file? Pin
gentleguy24-Jan-08 1:32
gentleguy24-Jan-08 1:32 
QuestionRe: how to save a file? Pin
CPallini24-Jan-08 1:54
mveCPallini24-Jan-08 1:54 
QuestionRe: how to save a file? Pin
David Crow23-Jan-08 2:44
David Crow23-Jan-08 2:44 
Generalstd::fstream and std::transform about lower case question Pin
Maxwell Chen22-Jan-08 19:16
Maxwell Chen22-Jan-08 19:16 
GeneralProblem is solved. Pin
Maxwell Chen22-Jan-08 19:34
Maxwell Chen22-Jan-08 19:34 
GeneralRe: std::fstream and std::transform about lower case question Pin
Stephen Hewitt22-Jan-08 19:44
Stephen Hewitt22-Jan-08 19:44 
GeneralRe: std::fstream and std::transform about lower case question Pin
Maxwell Chen23-Jan-08 16:09
Maxwell Chen23-Jan-08 16:09 
GeneralRe: std::fstream and std::transform about lower case question Pin
Stephen Hewitt24-Jan-08 11:59
Stephen Hewitt24-Jan-08 11:59 
GeneralRe: std::fstream and std::transform about lower case question Pin
Maxwell Chen24-Jan-08 16:21
Maxwell Chen24-Jan-08 16:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.