473,320 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Query on some code found within a struct

Hi,
This is a segement of code taken from Warren Young's FAQ on Winsock @
http://tangentsoft.net/wskfaq/

struct Connection {
SOCKET sd;
char acBuffer[kBufferSize];
int nCharsInBuffer;
Connection(SOCKET sd_) : sd(sd_), nCharsInBuffer(0) { }
};

Any idea what the second last line means? Is it an initialiser or
something?

Thanks,

Simon

Nov 14 '05 #1
3 1150
Simon2005 wrote:
Hi,
This is a segement of code taken from Warren Young's FAQ on Winsock @
http://tangentsoft.net/wskfaq/

struct Connection {
SOCKET sd;
char acBuffer[kBufferSize];
int nCharsInBuffer;
Connection(SOCKET sd_) : sd(sd_), nCharsInBuffer(0) { }
};

Any idea what the second last line means? Is it an initialiser or
something?

Thanks,

Simon

It's C++ code (`Connection()' is a constructor with initializers), hence
off-topic here.

HTH,
--ag

--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
Nov 14 '05 #2
Thought it might be C++. But the struct keyword made me think
otherwise.

Anyways, thanks for the help.

Simon.

Nov 14 '05 #3
In article <11**********************@o13g2000cwo.googlegroups .com>,
Simon2005 <si**********@clara.co.uk> wrote:
Thought it might be C++. But the struct keyword made me think
otherwise.


But struct is the same as class in C++. The difference is only
if private or public is the default at the top of the struct/class.

--
Göran Larsson http://www.mitt-eget.com/
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Bradford Chamberlain | last post by:
I work a lot with multidimensional arrays of dynamic size in C, implementing them using a single-dimensional C array and the appropriate multipliers and offsets to index into it appropriately. I...
4
by: C White | last post by:
Hi I am having problems with running a query that does the following there are 5 fields in a table that the query is based on, the first four are simple enough and all that happens is that the...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
5
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that...
2
by: Wade | last post by:
I am pretty new to Access, especially writing code, but I found code on the web to do just what I want and it is posted below. It returns a field value from a previous record. I found the code at:...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
4
by: Sheldon | last post by:
Hi, I have a unique case where I need an array of structs that grows and within this array is another struct that grows in some cases. I'm having trouble allocating memory. Since I have never...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.