Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 06:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Replace and Split...

Discussion on Replace and Split... within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
ernilos's Avatar
 
elite*gold: 20
Join Date: Jan 2012
Posts: 766
Received Thanks: 645
Replace and Split...

I'm fairly new in c, and I have two questions.
1. How I can replace letters in a variable? (login_packet) (~ to nothing)
2. How I can split the var login_packet? (with " ")
Thanks ..
ernilos is offline  
Old 08/29/2012, 20:35   #2


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Quote:
1. How I can replace letters in a variable? (login_packet) (~ to nothing)
You have to search for '~' (for example via strchr) and copy the whole string into a new one leaving out the found characters.

Quote:
2. How I can split the var login_packet? (with " ")
Thanks ..
Well, what do you mean?
Splitting one string that includes spaces into those substrings, seperated by the spaces?
If so, strtok may be of your interest.
MrSm!th is offline  
Old 08/29/2012, 21:44   #3
 
ernilos's Avatar
 
elite*gold: 20
Join Date: Jan 2012
Posts: 766
Received Thanks: 645
M.. I have that:
login_packet = "NoS0575 3995441 ernilos 10956354732165E3649465C265F47B3 00944304 0.9.3.2993 0 E472C68B9D7CB984A0AF7CD1A19B56C8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
remove the'~'
and split likes that:

NoS0575
3995441
ernilos
10956354732165E3649465C265F47B3
00944304 0.9.3.2993
0
E472C68B9D7CB984A0AF7CD1A19B56C8

Help.. :c
ernilos is offline  
Old 08/29/2012, 21:53   #4


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
I already told you.
MrSm!th is offline  
Reply


Similar Threads Similar Threads
Bildschirm Split?
08/18/2012 - Technical Support - 2 Replies
Ich habe folgende frage: Ich habe ein DVI & VGA Anschluss am bildschirm, am VGA ist mein pc angeschlossen am DVI meine xbox. Kann ich z.B auf dem desktop mein xbox bild sehen? sprich das ich so eine art fenster habe wo dann mein xbox bild drinnen ist
String Split
01/07/2012 - AutoIt - 5 Replies
hallo wie kann ich am besten so einen string splitten? "ababaaazzzzzzzzzzzzzzzzzzzzzzzzzzzacacaaazz zzzzzzzzzzzzzzzzzzzzzzzzzadadaaazzzzzzzzzzzzzzzzzz zzzzzzzz" "a" ist immer gleich "z" sind verschiedene Zeichen
gc split up
12/02/2010 - Grand Chase - 6 Replies
im confused i heard somethign about gc spliting up like with the chars and all but i dnt understand it how does it work and all ? its not comming anytime soon like in a month or so but hard to picture it
banana split
08/02/2007 - Conquer Online 2 - 21 Replies
hey guys, exacly haw does the bananasplit work? i know it takes all ur items off an botjails u. but when can i use this on people so it happens? haw do i know there using proxy is there a trick to it? cus some1 just lose full super 3 double soc armour rest one socs.
Server Split
04/06/2007 - Conquer Online 2 - 1 Replies
whos leaving hnor for ugly duckling? im not sure whether i should or not



All times are GMT +1. The time now is 06:59.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.