Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Sql(SqlSession& session) problem
Re: Sql(SqlSession& session) problem (SOLVED) [message #40328 is a reply to message #40326] Fri, 19 July 2013 19:25 Go to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
pfsdanny wrote on Fri, 19 July 2013 15:57

Should you please explain these 2 lines. I don't understand what it means. I am new to C, thanks.
DBData() : port(3306) { }
DBData(const String& username, const String& password,
 const String& database, const String& host, 
 const String& collate, const String& lockId, int port = 3306) :
 username(username), 	password(password), database(database), 
 host(host), collate(collate), lockId(lockId), port(port) { }



This feature is called C++ constructor initialization lists, where possible to do implicit assignments (when variables are created), instead of explicit assignments (afterwards):
	DBData() { port = 3306; }
	DBData(const String& username, const String& password, const String& database, const String& host,
		const String& collate, const String& lockId, int port = 3306)
	{
		this->username = username; this->password = password; this->database = database;
		this->host = host; this->collate = collate; this->lockId = lockId; this->port = port;
	}

[Updated on: Fri, 19 July 2013 20:00]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [BUG] Memory leak in MySql package
Next Topic: MS SQL Server CE Assistance
Goto Forum:
  


Current Time: Sun Jun 08 17:15:18 CEST 2025

Total time taken to generate the page: 0.04298 seconds