473,513 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C programmer, what does this syntax mean?

I am a bit confused with the two marked lines. I have never seen such syntax
even though I read a lot
of C++ codes.

Thanks for your suggestion...

BluetoothReceiver::BluetoothReceiver()
: bandpassFilter(BPLENGTH), <--- Here
differentiatorFilter(DIFFLENGTH) <--- Here
{
m_bitrate = 1;
m_bitDelay = BITDELAYBT;

// Compute Bandpass filter coefficients and
const double h0 = sqrt(2.0) * Br;
const double kexp = -twopi * Br * Br;
for (int i=0; i<bandpassFilter.size(); ++i) {
double temp = i - (BPLENGTH *1.)/2.+.5;
temp /= Ns;
double hreal = h0 * exp(kexp * temp * temp);
bandpassFilter[i] = Sample(hreal,0.0);
}

// Set Differentiator filter coefficients
differentiatorFilter[0] = Sample(-0.0062, 0.0);
differentiatorFilter[1] = Sample(0.0372, 0.0);
differentiatorFilter[2] = Sample(-0.4566, 0.0);
differentiatorFilter[3] = Sample(0.4566, 0.0);
differentiatorFilter[4] = Sample(-0.0372, 0.0);
differentiatorFilter[5] = Sample(0.0062, 0.0);
}



Jul 22 '05 #1
4 1263
On Fri, 21 Jan 2005 21:43:38 +0800, Feverish <fe*********@h0tmail.c0nn>
wrote:
I am a bit confused with the two marked lines. I have never seen such
syntax
even though I read a lot
of C++ codes.

Thanks for your suggestion...

BluetoothReceiver::BluetoothReceiver()
: bandpassFilter(BPLENGTH), <--- Here
differentiatorFilter(DIFFLENGTH) <--- Here
{
m_bitrate = 1;
m_bitDelay = BITDELAYBT;

// Compute Bandpass filter coefficients and
const double h0 = sqrt(2.0) * Br;
const double kexp = -twopi * Br * Br;
for (int i=0; i<bandpassFilter.size(); ++i) {
double temp = i - (BPLENGTH *1.)/2.+.5;
temp /= Ns;
double hreal = h0 * exp(kexp * temp * temp);
bandpassFilter[i] = Sample(hreal,0.0);
}

// Set Differentiator filter coefficients
differentiatorFilter[0] = Sample(-0.0062, 0.0);
differentiatorFilter[1] = Sample(0.0372, 0.0);
differentiatorFilter[2] = Sample(-0.4566, 0.0);
differentiatorFilter[3] = Sample(0.4566, 0.0);
differentiatorFilter[4] = Sample(-0.0372, 0.0);
differentiatorFilter[5] = Sample(0.0062, 0.0);
}

supposed that bandpassFilter and differentiatorFilter are member variables
of class BluetoothReceiver, your to marked lines are the initialiser list
of class BluetoothReceiver's constructor.
at this place, you cannot only initialize member variables, but also call
base class constructors.
--
have a nice day
ulrich
Jul 22 '05 #2
Ulrich Achleitner wrote:
On Fri, 21 Jan 2005 21:43:38 +0800, Feverish
<fe*********@h0tmail.c0nn> wrote:
I am a bit confused with the two marked lines. I have never seen such
syntax
even though I read a lot
of C++ codes.

Thanks for your suggestion...

BluetoothReceiver::BluetoothReceiver()
bandpassFilter(BPLENGTH), <--- Here


Assuming the OP delete a preceding ':' here, other wise this would cause a
compilation error.
differentiatorFilter(DIFFLENGTH) <--- Here
{
m_bitrate = 1;
m_bitDelay = BITDELAYBT;

// Compute Bandpass filter coefficients and
const double h0 = sqrt(2.0) * Br;
const double kexp = -twopi * Br * Br;
for (int i=0; i<bandpassFilter.size(); ++i) {
double temp = i - (BPLENGTH *1.)/2.+.5;
temp /= Ns;
double hreal = h0 * exp(kexp * temp * temp);
bandpassFilter[i] = Sample(hreal,0.0);
}

// Set Differentiator filter coefficients
differentiatorFilter[0] = Sample(-0.0062, 0.0);
differentiatorFilter[1] = Sample(0.0372, 0.0);
differentiatorFilter[2] = Sample(-0.4566, 0.0);
differentiatorFilter[3] = Sample(0.4566, 0.0);
differentiatorFilter[4] = Sample(-0.0372, 0.0);
differentiatorFilter[5] = Sample(0.0062, 0.0);
}

supposed that bandpassFilter and differentiatorFilter are member
variables of class BluetoothReceiver, your to marked lines are the
initialiser list of class BluetoothReceiver's constructor.
at this place, you cannot only initialize member variables, but also
call base class constructors.

Jul 22 '05 #3

"Jeff Flinn" <NO****@nowhere.com> wrote in message
news:cs**********@bluegill.adi.com...

BluetoothReceiver::BluetoothReceiver()
bandpassFilter(BPLENGTH), <--- Here

Assuming the OP delete a preceding ':' here, other wise this would cause a
compilation error.


See the original post. The colon is there (second line).

-Mike
Jul 22 '05 #4
Jeff Flinn wrote:
Ulrich Achleitner wrote:
On Fri, 21 Jan 2005 21:43:38 +0800, Feverish
<fe*********@h0tmail.c0nn> wrote:
I am a bit confused with the two marked lines. I have never seen
such syntax even though I read a lot of C++ codes.

Thanks for your suggestion...

BluetoothReceiver::BluetoothReceiver()

bandpassFilter(BPLENGTH), <--- Here


Assuming the OP delete a preceding ':' here, other wise this would
cause a compilation error.

<snip excessive quote>

It appears that you use OE-QuoteFix, but it still somehow managed to
screw up the first paragraph. Which, among other things, recognises
certain oddball quoting prefixes and turns them all into the 'standard'
greater-than signs. This has happened in this instance, hence the
apparent extra quoting level.

I used to use OEQF too, but forget if it would've left the colon put if
it were indented by a certain number of spaces.

Stewart.

--
My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.
Jul 23 '05 #5

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

Similar topics

3
3225
by: Christian McArdle | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.os.ms-windows.programmer.64bit This is a formal Request For Discussion (RFD) to create comp.os.ms-windows.programmer.64bit as an unmoderated...
13
2470
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic...
0
5522
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
65
5165
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7114
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7541
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.