Click here to Skip to main content
16,016,562 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Copy the string from const char* To char[500]; Pin
carter200013-Jul-09 21:49
carter200013-Jul-09 21:49 
AnswerRe: Copy the string from const char* To char[500]; Pin
Cedric Moonen13-Jul-09 21:49
Cedric Moonen13-Jul-09 21:49 
AnswerRe: Copy the string from const char* To char[500]; Pin
CPallini13-Jul-09 22:00
mveCPallini13-Jul-09 22:00 
GeneralRe: Copy the string from const char* To char[500]; Pin
ksaw12313-Jul-09 22:19
ksaw12313-Jul-09 22:19 
GeneralRe: Copy the string from const char* To char[500]; Pin
Cedric Moonen13-Jul-09 22:34
Cedric Moonen13-Jul-09 22:34 
GeneralRe: Copy the string from const char* To char[500]; Pin
CPallini13-Jul-09 22:48
mveCPallini13-Jul-09 22:48 
GeneralRe: Copy the string from const char* To char[500]; Pin
Cedric Moonen13-Jul-09 22:55
Cedric Moonen13-Jul-09 22:55 
GeneralRe: Copy the string from const char* To char[500]; Pin
CPallini13-Jul-09 23:19
mveCPallini13-Jul-09 23:19 
Cedric Moonen wrote:
Yes I know that it was simple but you are suggesting to the OP that each time he has to copy a string, he should use this code.

Nope, I would suggest him to use the library functions actually. I posted the code just to show how the task could be accomplished without using such functions (as a side note to other answers).

Cedric Moonen wrote:
Honnestly, I really don't think it is a good idea

I agree, because library functions are more general.


Cedric Moonen wrote:
because it makes the code much more difficult to understand (suppose that you repeat that code in a lot of places in your code Dead ).

I disagree. OP should have at least a rough idea on what happens behind the curtains of the library functions. Repeating the code is a very bad practice that I would never suggest. I suppose that showing a piece of code is not a boost to 'inline' code instead of properly 'wrap the code with a function and then call it everywhere it is needed'.


Cedric Moonen wrote:
And apparently, that's what the OP is going to do instead of using one of the "built in" mechanism

I'm really not so clever to guess OP intentions. Anyway I would suggest him to use library functions (that anyway are not, in my opinion, a built-in mechanism...).

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.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

JokeRe: Copy the string from const char* To char[500]; Pin
killabyte13-Jul-09 22:50
killabyte13-Jul-09 22:50 
GeneralRe: Copy the string from const char* To char[500]; Pin
CPallini13-Jul-09 23:25
mveCPallini13-Jul-09 23:25 
AnswerRe: Copy the string from const char* To char[500]; Pin
Stuart Dootson13-Jul-09 23:30
professionalStuart Dootson13-Jul-09 23:30 
JokeRe: Copy the string from const char* To char[500]; Pin
CPallini13-Jul-09 23:48
mveCPallini13-Jul-09 23:48 
JokeRe: Copy the string from const char* To char[500]; Pin
Stuart Dootson13-Jul-09 23:56
professionalStuart Dootson13-Jul-09 23:56 
JokeRe: Copy the string from const char* To char[500]; Pin
CPallini14-Jul-09 0:01
mveCPallini14-Jul-09 0:01 
QuestionPeriod and Duty cycle calculation [modified] Pin
sks8313-Jul-09 20:37
sks8313-Jul-09 20:37 
AnswerRe: Period and Duty cycle calculation Pin
LittleYellowBird13-Jul-09 21:52
LittleYellowBird13-Jul-09 21:52 
GeneralRe: Period and Duty cycle calculation Pin
sks8313-Jul-09 22:17
sks8313-Jul-09 22:17 
GeneralRe: Period and Duty cycle calculation Pin
Stuart Dootson13-Jul-09 22:32
professionalStuart Dootson13-Jul-09 22:32 
GeneralRe: Period and Duty cycle calculation Pin
sks8313-Jul-09 23:01
sks8313-Jul-09 23:01 
GeneralRe: Period and Duty cycle calculation Pin
Stuart Dootson13-Jul-09 23:05
professionalStuart Dootson13-Jul-09 23:05 
GeneralRe: Period and Duty cycle calculation Pin
Cedric Moonen13-Jul-09 23:07
Cedric Moonen13-Jul-09 23:07 
GeneralRe: Period and Duty cycle calculation [modified] Pin
sks8313-Jul-09 23:12
sks8313-Jul-09 23:12 
GeneralRe: Period and Duty cycle calculation Pin
Cedric Moonen13-Jul-09 23:19
Cedric Moonen13-Jul-09 23:19 
GeneralRe: Period and Duty cycle calculation Pin
sks8313-Jul-09 23:56
sks8313-Jul-09 23:56 
GeneralRe: Period and Duty cycle calculation Pin
LittleYellowBird14-Jul-09 0:05
LittleYellowBird14-Jul-09 0:05 

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.