Raised This Month: $ Target: $400
 0% 

Solved Replace in a String that Contains Repeated Chars


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
asdian
Member
Join Date: Sep 2016
Location: Indonesia
Old 07-24-2022 , 12:09   Re: Replace in a String that Contains Repeated Chars
Reply With Quote #15

Quote:
Originally Posted by Shadows Adi View Post
Code:
// By defining a new variable which stores the string lenght, you avoid multiple function calls ( improving the performance ) new iLen = strlen(szCos) if(szCos[iLen - 4] == 't' && szCos[iLen - 3] == 'h' && szCos[iLen - 2] == 'i' && szCos[iLen - 1] == 's') {     // meets the criterias, execute }
now after i did that, it gives me index out of bounds error. previously it works fine. this is driving me nuts !

*edit
nvm, fixed now. just forgot to modify some data

Last edited by asdian; 07-24-2022 at 12:24.
asdian is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode