Click here to Skip to main content
15,891,951 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hexidecimal to decimal conversion Pin
Niklas L11-Apr-02 6:00
Niklas L11-Apr-02 6:00 
GeneralRe: Hexidecimal to decimal conversion Pin
Ravi Bhavnani11-Apr-02 6:20
professionalRavi Bhavnani11-Apr-02 6:20 
GeneralConsole Font/Color Pin
EvilSource11-Apr-02 4:56
EvilSource11-Apr-02 4:56 
GeneralRe: Console Font/Color Pin
moliate11-Apr-02 5:56
moliate11-Apr-02 5:56 
Generalwindow size Pin
Rajveer11-Apr-02 3:51
Rajveer11-Apr-02 3:51 
GeneralRe: window size Pin
Mazdak11-Apr-02 4:45
Mazdak11-Apr-02 4:45 
GeneralRe: window size Pin
Joel Holdsworth11-Apr-02 4:51
Joel Holdsworth11-Apr-02 4:51 
GeneralI'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 3:56
LukeV11-Apr-02 3:56 
Ok... don't comment on the logical side of this code, I just have a small question that needs to be answered...;P

This code will give me a "user breakpoint" before exiting if I keep "for(i=6;i<8; i++)". BUT, change that to "for(i=6;i<7; i++)", which will obviously go through the loop only once, will work and exit properly.

So I guess that I don't even know how to use chars anymore (thanks to MFC and CString!!!) And I need to know why it won't work and what is the proper way to achieve what I want to do. Here's the code:

int main(int argc, char* argv[])
{
int i = 6;

char *pBody = new char;
char sz[4] = "test";

strcpy( pBody, "\0" );
for(i=6;i<8; i++)
{

strcat( pBody, sz );

strcat( pBody, ": " );

strcat( pBody, sz );

strcat( pBody, "\n" );

}

strcat( pBody, "\0" );

return 0;

delete [] pBody;
pBody = NULL;
}

Also, I guess it would be a nice thing for me to re-learn C/C++... Wink | ;) I feel like a hobbyist... Frown | :(

Thanks!

---------------
Ok, we suck at C/C++, but we're good at website design and MFC apps!!!
http://www.edovia.com
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 4:13
LukeV11-Apr-02 4:13 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 4:23
Bernhard11-Apr-02 4:23 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 4:27
LukeV11-Apr-02 4:27 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 4:31
Bernhard11-Apr-02 4:31 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 4:34
LukeV11-Apr-02 4:34 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 4:37
Bernhard11-Apr-02 4:37 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
luckylours11-Apr-02 4:36
luckylours11-Apr-02 4:36 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Oz Ben Eliezer11-Apr-02 13:45
Oz Ben Eliezer11-Apr-02 13:45 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 20:02
Bernhard11-Apr-02 20:02 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Tim Smith11-Apr-02 10:16
Tim Smith11-Apr-02 10:16 
GeneralSTL and VC++ Pin
xicoloko11-Apr-02 3:39
xicoloko11-Apr-02 3:39 
GeneralRe: STL and VC++ Pin
Nish Nishant11-Apr-02 7:23
sitebuilderNish Nishant11-Apr-02 7:23 
GeneralRe: STL and VC++ Pin
Tim Smith11-Apr-02 10:16
Tim Smith11-Apr-02 10:16 
GeneralRe: STL and VC++ Pin
Mike Nordell11-Apr-02 9:00
Mike Nordell11-Apr-02 9:00 
GeneralWINDOWPLACEMENT Pin
NC11-Apr-02 3:37
NC11-Apr-02 3:37 
GeneralRe: WINDOWPLACEMENT Pin
Jeremy Falcon11-Apr-02 10:11
professionalJeremy Falcon11-Apr-02 10:11 
QuestionA nice CGI class for... GCI apps??? Pin
LukeV11-Apr-02 3:29
LukeV11-Apr-02 3:29 

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.