Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 22:08

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

Advertisement



String vs CString Source differences

Discussion on String vs CString Source differences within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2009
Posts: 65
Received Thanks: 46
String vs CString Source differences

Hey there,
currently trying to make a "proper base source" form a few released ones out there, for testing different things. Ketchup's (Other forum) and Blouflash's for those interested in the particular sources.

Within the "Script.cpp & Script.h"

Lot's of differences like where it's "string" in one source and "CString" in another one, duo to my lack of programming skills, it doesn't make much sense.
My question is, what's the difference between those? I would guess, it doesn't really matter, since the sources work and no complications appear?

Few examples:
Code:
	static map<string, int>		m_defines;
	static map<string, string>	m_mapString;


	static map<CString, int>		m_defines;
	static map<CString,CString>		m_mapString;
Code:
		bool bResult = m_mapString.insert( map<string, string>::value_type( (LPCTSTR)str, (LPCTSTR)Token ) ).second;


		bool bResult = m_mapString.insert( map<CString, CString>::value_type( (LPCTSTR)str, (LPCTSTR)Token ) ).second;

Code:
	CScanner::GetToken( FALSE );
	string str = token;
	CScanner::GetToken( FALSE );


	CScanner::GetToken( FALSE );
	CString str = token;
	CScanner::GetToken( FALSE );
VirusAtwar is offline  
Old 05/01/2020, 18:02   #2
 
Naltalah's Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 308
Received Thanks: 372
The main difference is that string, or in this case, std::string is a class provided by the C++ STL, while CString is ATL specific.

I haven't looked into all of the details, but I guess a lot of methods will be different when it comes to concatenating, formating, etc.

They're both just String-Classes, so idk why one source uses CString (which is offi code) and the other one just uses std::string, probably just a matter of personal taste.


Naltalah is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Frage] DWORD zu CString
10/15/2011 - Flyff Private Server - 3 Replies
Hey, hab da mal eine Frage undzwar würde ich gerne eine DWORD Variable (m_pFocusItem->dwLevel) in einen CString konvertieren, habe auch schon gegoogelt, verstehe das mit sprintf() allerdings nicht so richtig >.< MFG Yakuzai.
Dynamisches Cstring Array mit new oder malloc() oder wie jetz???
05/07/2010 - General Coding - 4 Replies
Gelöst Hallo, Erstens ich habe schon gegoogelt (Google is mein Freund :D), aber dies hat mir nicht wirklich weitergeholfen |: Also ich möchte über die funktion getline() von einer Datei die Strings in einen dyn array schreiben. Ich habe dazu erstmal einen Zeilencounter implementiert der auch wunderbar funktioniert. Mit diesen counter will ich ja das array dynamisch allozieren doch ich hab da iwie Probleme. ein kleines bsp



All times are GMT +1. The time now is 22:08.


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.