Click here to Skip to main content
15,914,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem in #import statement Pin
Sakthiu16-Nov-06 1:30
Sakthiu16-Nov-06 1:30 
QuestionRe: Problem in #import statement Pin
prasad_som16-Nov-06 1:49
prasad_som16-Nov-06 1:49 
AnswerRe: Problem in #import statement Pin
Sakthiu16-Nov-06 1:56
Sakthiu16-Nov-06 1:56 
QuestionRe: Problem in #import statement Pin
prasad_som16-Nov-06 2:31
prasad_som16-Nov-06 2:31 
AnswerRe: Problem in #import statement Pin
bob1697216-Nov-06 3:27
bob1697216-Nov-06 3:27 
AnswerRe: Problem in #import statement Pin
Hamid_RT16-Nov-06 8:06
Hamid_RT16-Nov-06 8:06 
Questionstrncpy.... [modified] Pin
Programm3r16-Nov-06 1:27
Programm3r16-Nov-06 1:27 
AnswerRe: strncpy.... [modified] Pin
kakan16-Nov-06 2:07
professionalkakan16-Nov-06 2:07 
If you want to do it in plain old C, here is a way:

char fileName[20];
strcpy(fileName, "FileName1.txt");

// Now change extension to ".abc"

// "Smart" coding, assumes there is a dot in the filename
strcpy(strrchr(fileName, '.'), ".txt");

OR (safer):
char * cpDot = strrchr(fileName, '.');
if(NULL != cpDot) strcpy(cpDot, ".txt");


Let the flaming begin! (I won't answer, I have work to do).



-- modified at 8:30 Thursday 16th November, 2006
Thanks, toxcct!


Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

GeneralRe: strncpy.... Pin
toxcct16-Nov-06 2:19
toxcct16-Nov-06 2:19 
GeneralRe: strncpy.... Pin
kakan16-Nov-06 2:33
professionalkakan16-Nov-06 2:33 
GeneralRe: strncpy.... Pin
Programm3r16-Nov-06 3:03
Programm3r16-Nov-06 3:03 
GeneralRe: strncpy.... Pin
Programm3r16-Nov-06 3:01
Programm3r16-Nov-06 3:01 
GeneralRe: strncpy.... Pin
kakan16-Nov-06 4:21
professionalkakan16-Nov-06 4:21 
AnswerRe: strncpy [modified] Pin
prasad_som16-Nov-06 2:41
prasad_som16-Nov-06 2:41 
GeneralRe: strncpy.... Pin
toxcct16-Nov-06 2:58
toxcct16-Nov-06 2:58 
GeneralRe: strncpy.... Pin
prasad_som16-Nov-06 3:01
prasad_som16-Nov-06 3:01 
GeneralRe: strncpy.... Pin
toxcct16-Nov-06 3:09
toxcct16-Nov-06 3:09 
GeneralRe: strncpy.... Pin
Programm3r16-Nov-06 3:00
Programm3r16-Nov-06 3:00 
GeneralRe: strncpy.... Pin
prasad_som16-Nov-06 3:10
prasad_som16-Nov-06 3:10 
GeneralRe: strncpy.... Pin
Programm3r16-Nov-06 3:14
Programm3r16-Nov-06 3:14 
GeneralRe: strncpy.... Pin
David Crow16-Nov-06 4:03
David Crow16-Nov-06 4:03 
GeneralRe: strncpy.... Pin
prasad_som16-Nov-06 18:12
prasad_som16-Nov-06 18:12 
QuestionRe: strncpy.... Pin
David Crow16-Nov-06 4:04
David Crow16-Nov-06 4:04 
QuestionHow to read file in reverse order? Pin
ashokbngr16-Nov-06 1:21
ashokbngr16-Nov-06 1:21 
AnswerRe: How to read file in reverse order? Pin
Anthony Mushrow16-Nov-06 1:57
professionalAnthony Mushrow16-Nov-06 1:57 

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.