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

C / C++ / MFC

 
Questionsubstr and find of string Pin
George_George4-Sep-08 0:48
George_George4-Sep-08 0:48 
Hello everyone,


Just two bacis questions about how to program in an elegant way.

1. About string.find, whether using string::npos or -1 to check no match find is more elegant?

2. About string.substr, whether checking return value is null or not is an elegant way to know if substr method is successful?


thanks in advance,
George
AnswerRe: substr and find of string Pin
Karismatic4-Sep-08 1:14
Karismatic4-Sep-08 1:14 
GeneralRe: substr and find of string Pin
George_George4-Sep-08 19:37
George_George4-Sep-08 19:37 
AnswerRe: substr and find of string Pin
markkuk4-Sep-08 11:25
markkuk4-Sep-08 11:25 
GeneralRe: substr and find of string Pin
George_George4-Sep-08 19:40
George_George4-Sep-08 19:40 
QuestionHow to know the availability of COM ports that are attached to our computer programmatically ? Pin
kapardhi3-Sep-08 23:55
kapardhi3-Sep-08 23:55 
AnswerRe: How to know the availability of COM ports that are attached to our computer programmatically ? Pin
Rane4-Sep-08 0:41
Rane4-Sep-08 0:41 
GeneralRe: How to know the availability of COM ports that are attached to our computer programmatically ? Pin
kapardhi4-Sep-08 2:10
kapardhi4-Sep-08 2:10 
QuestionRe: How to know the availability of COM ports that are attached to our computer programmatically ? Pin
David Crow4-Sep-08 3:46
David Crow4-Sep-08 3:46 
AnswerRe: How to know the availability of COM ports that are attached to our computer programmatically ? Pin
Roger Stoltz4-Sep-08 2:28
Roger Stoltz4-Sep-08 2:28 
GeneralRe: How to know the availability of COM ports that are attached to our computer programmatically ? Pin
kapardhi4-Sep-08 2:58
kapardhi4-Sep-08 2:58 
AnswerRe: How to know the availability of COM ports that are attached to our computer programmatically ? Pin
Roger Stoltz4-Sep-08 3:09
Roger Stoltz4-Sep-08 3:09 
QuestionProblem in zooming the image. Pin
Bernaad3-Sep-08 23:24
Bernaad3-Sep-08 23:24 
AnswerRe: Problem in zooming the image. Pin
SandipG 3-Sep-08 23:31
SandipG 3-Sep-08 23:31 
GeneralRe: Problem in zooming the image. Pin
Bernaad3-Sep-08 23:51
Bernaad3-Sep-08 23:51 
GeneralRe: Problem in zooming the image. Pin
SandipG 3-Sep-08 23:55
SandipG 3-Sep-08 23:55 
GeneralRe: Problem in zooming the image. Pin
Bernaad4-Sep-08 0:12
Bernaad4-Sep-08 0:12 
GeneralRe: Problem in zooming the image. Pin
Mark Salsbery4-Sep-08 5:24
Mark Salsbery4-Sep-08 5:24 
Question怎么取得当前使用的计算机的用户名呢 Pin
alphaxz3-Sep-08 23:19
alphaxz3-Sep-08 23:19 
AnswerRe: The correct answer is Pin
Rajesh R Subramanian3-Sep-08 23:20
professionalRajesh R Subramanian3-Sep-08 23:20 
AnswerRe: YOU LOOSER Pin
toxcct3-Sep-08 23:26
toxcct3-Sep-08 23:26 
GeneralRe: YOU LOOSER Pin
alphaxz3-Sep-08 23:43
alphaxz3-Sep-08 23:43 
GeneralRe: YOU LOOSER Pin
SandipG 3-Sep-08 23:46
SandipG 3-Sep-08 23:46 
GeneralRe: YOU LOOSER Pin
ThatsAlok3-Sep-08 23:51
ThatsAlok3-Sep-08 23:51 
GeneralRe: YOU LOOSER Pin
David Crow4-Sep-08 3:49
David Crow4-Sep-08 3:49 

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.