Click here to Skip to main content
15,887,585 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question Pin
rfixxxer3-Aug-04 6:07
rfixxxer3-Aug-04 6:07 
QuestionTransparent button control over a dialog in WinCE ? Pin
Arun AC3-Aug-04 5:19
Arun AC3-Aug-04 5:19 
GeneralNotification popup Pin
Riderman373-Aug-04 4:37
Riderman373-Aug-04 4:37 
GeneralRe: Notification popup Pin
valikac3-Aug-04 5:48
valikac3-Aug-04 5:48 
GeneralRe: Notification popup Pin
David Crow3-Aug-04 5:51
David Crow3-Aug-04 5:51 
GeneralSending an interrupt to a process Pin
Member 6256663-Aug-04 4:23
Member 6256663-Aug-04 4:23 
GeneralRe: Sending an interrupt to a process Pin
jmkhael3-Aug-04 5:18
jmkhael3-Aug-04 5:18 
GeneralLocating chars in strings etc. Pin
CreepingFeature3-Aug-04 4:16
CreepingFeature3-Aug-04 4:16 
It's a bitch! Mad | :mad:

Anyhow here is the thing I got myself a string, just a word.

I need to locate a char in it and then erase it, also it must be done in a loop so that if char is in there twice etc. it would be deleted.

Problem: What if char doesn't exist in the string.

I tried to use if( !(blahblah.find(char)) ) doesn't work because if .find
doesn't see the char it throws the value of char position out of range of length of string or drops it bellow zero, causes an out of range error.
(This took me half a day to figure out) Mad | :mad:

So I used: if( (blahblah.find(char) < 0) || (blahblah.find(char) => Length) )
same crap!

Two hours later found strpbrk()!

How can I use it together with strlen to simplify the condition and avoid
out of range error during run-time.

Basicaly what I need is to look at a string, single word. Check if it has a char I provide. If it doesn't I need the if-statment to fall thru.
But if it does have it I need to erase it, this I can do Laugh | :laugh: .
GeneralRe: Locating chars in strings etc. Pin
Nigel Savidge3-Aug-04 4:55
Nigel Savidge3-Aug-04 4:55 
GeneralRe: Locating chars in strings etc. Pin
CreepingFeature3-Aug-04 7:08
CreepingFeature3-Aug-04 7:08 
GeneralRe: Locating chars in strings etc. Pin
David Crow3-Aug-04 5:56
David Crow3-Aug-04 5:56 
GeneralCListCtrl - number of icons displayed. Pin
John-Lucas Brown3-Aug-04 3:20
John-Lucas Brown3-Aug-04 3:20 
GeneralRe: CListCtrl - number of icons displayed. Pin
Graham Bradshaw3-Aug-04 8:05
Graham Bradshaw3-Aug-04 8:05 
GeneralOpening any Ext. pacakage in a view port Pin
sangit843-Aug-04 2:50
professionalsangit843-Aug-04 2:50 
GeneralCombo box window text Pin
gokings3-Aug-04 2:40
gokings3-Aug-04 2:40 
GeneralRe: Combo box window text Pin
Ravi Bhavnani3-Aug-04 3:10
professionalRavi Bhavnani3-Aug-04 3:10 
GeneralRe: Combo box window text Pin
gokings3-Aug-04 8:58
gokings3-Aug-04 8:58 
GeneralRe: Combo box window text Pin
RChin3-Aug-04 3:26
RChin3-Aug-04 3:26 
GeneralRe: Combo box window text Pin
gokings3-Aug-04 9:00
gokings3-Aug-04 9:00 
GeneralOverlays Pin
sweep1233-Aug-04 1:58
sweep1233-Aug-04 1:58 
GeneralHardware Interrupt Handling Pin
Erwin_Cebu3-Aug-04 1:13
Erwin_Cebu3-Aug-04 1:13 
GeneralRe: Hardware Interrupt Handling Pin
Henry miller3-Aug-04 4:09
Henry miller3-Aug-04 4:09 
GeneralRe: Hardware Interrupt Handling Pin
Erwin_Cebu3-Aug-04 19:05
Erwin_Cebu3-Aug-04 19:05 
Generalload image,display n convert to grayscale in c++ Pin
kalaichris3-Aug-04 0:55
kalaichris3-Aug-04 0:55 
GeneralRe: load image,display n convert to grayscale in c++ Pin
Ravi Bhavnani3-Aug-04 1:40
professionalRavi Bhavnani3-Aug-04 1:40 

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.