Wednesday, October 30, 2013

Why string's c_str()? [Overloading const char *()]

Newsgroup: comp.lang.c++

Subject: Why string's c_str()? [Overloading const char *()]

From: DSF <notavalid@...>

Date: Wed, 30 Oct 2013 15:00:26 -0400



Hello group!



I have been using/writing my own string class for some time now. A

while back, I discovered the wonderful ability to overload const char

*. I was now able to use my string anywhere I could use const char *.

But... I had always wondered why the STL string class uses c_str()

instead of overloading const char *(). My first thought on the

subject is that it frees the string class to store the string in any

manner the coder chooses. One option would be to use the format of

[length of string][string]. But then I started reading articles

online stating that overloading const char *() is a bad idea because

it can allow unintended implicit conversions. Of course, most of

these articles used the typical overkill terms such as "dangerous" and

"evil", etc. Without going into detail of the specific dangers and

evils.



I came upon a discussion at the site below that intrigued me.



http://www.dreamincode.net/forums/topic/260662-operator-const-char-and-operator-caveats-with-overloads/



Since the site thread is fairly old, I decided to ask here.



I've reposted a small section here. (I hope they don't mind.)



//start

D.I.C Lover

Re: operator const char* and operator[] - caveats with overloads?



Posted 21 December 2011 - 02:18 PM

The problems will arise from ambiguous conversions. In C++, if you

have a statement with two different types, the compiler will try to

find a cast for one or the other so that the statement can be

evaluated. Now when you start adding conversions like this, you can't

prepare for every possible use of your class. Because of this, someone

who doesn't fully understand the language might try to use your class

in such a way that ambiguous conversions occur. The fact that the

designers of the std::string class left out a conversion operator, is

enough of an explanation to tell me that it should be avoided.



View Postmonkey_05_06, on 21 December 2011 - 03:52 PM, said:

What would be considered "accidental" or "unintended" conversions to

char*?



Things that come to mind are.



01 String a, b;

02 if (a==B) {}

03 if (a=="str") {}

04 if ("str"==a) {}

05 if ("str"!=a) {}

06 if (a > B) {}

07 if (a <= B) {}

08 if ("str" < a) {}

09 *a;

10 (a + 5);



All these things will suddenly just compile, but none of these will do

what you expect from a String class.



What Karel-Lodewijk said is exactly what I am talking about. Without a

conversion operator, most of those statements will not compile. With a

conversion operator they WILL compile, but not do what you expected.

If you feel like chasing around hard to find bugs, then leave it in

there, if not just add a function like the std::string::c_str().

//end





The examples above along with "none of these will do what you expect

from a String class" aroused my curiosity. Except for 09 and 10, I

was pretty certain the rest would do what I expect them to.



So I compiled the above with my string class, adding the harmless

getch() (wait for a keypress) within all of the {} so the whole thing

wouldn't be optimized away and to test the result of the if

statements. I also ran it with string 'a' initialized to "str".



Every single one of the first 8 did exactly what I expected.



9 did nothing (of course), but walking through the assembly code

confirmed it returned a pointer to the first character of string 'a'.

I added a char c; statement, then c = *a; then a printf using 'c' and

it worked. Funny, the compiler won't optimize *a; away, but with the

statement c=*a; it will optimize away the c= if you don't use the 'c'

leaving the *a code intact.



10 I wasn't sure about. Of course, it also did nothing on the

surface, but below it got a pointer to 'a', added 5 to it and returned

the resulting pointer. An overrun with a = "" or a = "str", but

that's not the point.



So what is the "danger" of overloading * (or in the case of above *

and [])? Everything I've written so far has worked as I expected, and

it's very convenient and looks more elegant than the alternatives when

one needs to pass a const char * to an API call, etc.



"'Later' is the beginning of what's not to be."

D.S. Fiscus







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?118599-Why-string-s-c_str()-Overloading-const-char-*()&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

[ANN] ODB C++ ORM 2.3.0 released, adds schema evolution support

Newsgroup: comp.lang.c++

Subject: [ANN] ODB C++ ORM 2.3.0 released, adds schema evolution support

From: Boris Kolpackov <boris@...>

Date: Wed, 30 Oct 2013 06:59:16 -0500



I am pleased to announce the release of ODB 2.3.0.



ODB is an open source object-relational mapping (ORM) system for C++. It

allows you to persist C++ objects to a relational database without having

to deal with tables, columns, or SQL and without manually writing any of

the mapping code.



Major new features in this release:



* Support for database schema evolution, including automatic schema

migration, immediate and gradual data migration, as well as soft

object model changes (ability to work with multiple schema versions

using the same C++ classes).



For a quick showcase of this functionality see the Changing Persistent

Classes section in the Hello World Example chapter:



http://www.codesynthesis.com/products/odb/doc/manual.xhtml#2.9



* Support for object sections which provide the ability to split data

members of a persistent C++ class into independently loaded/updated

groups.



* Support for automatic mapping of C++11 enum classes.



A more detailed discussion of these features can be found in the following

blog post:



http://www.codesynthesis.com/~boris/blog/2013/10/30/odb-2-3-0-released/



For the complete list of new features in this version see the official

release announcement:



http://www.codesynthesis.com/pipermail/odb-announcements/2013/000037.html



ODB is written in portable C++ (both C++98/03 and C++11 are supported) and

you should be able to use it with any modern C++ compiler. In particular, we

have tested this release on GNU/Linux (x86/x86-64/ARM), Windows (x86/x86-64),

Mac OS X (x86), and Solaris (x86/x86-64/SPARC) with GNU g++ 4.2.x-4.8.x,

MS Visual C++ 2005, 2008, 2010, and 2012, Sun Studio 12u2, and Clang 3.x.



The currently supported database systems are MySQL, SQLite, PostgreSQL,

Oracle, and SQL Server. ODB also provides optional profiles for Boost and

Qt, which allow you to seamlessly use value types, containers, and smart

pointers from these libraries in your persistent classes.



More information, documentation, source code, and pre-compiled binaries are

available from:



http://www.codesynthesis.com/products/odb/



Enjoy,

Boris







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?118324-ANN-ODB-C-ORM-2-3-0-released-adds-schema-evolution-support&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Tuesday, October 29, 2013

How to pronounce "Bjarne Stroustrup"?

Newsgroup: comp.lang.c++

Subject: Re: How to pronounce "Bjarne Stroustrup"?

From: ronda.fondell@...

Date: Tue, 29 Oct 2013 13:37:37 -0700 (PDT)



On Sunday, May 8, 1994 1:21:04 PM UTC-5, josh weinstein wrote:

> And why isn't this in the FAQ?

>

> --

> --Shimon (despite the vociferous counterclaims of From: )

> --The soul is more than the hum of its parts.



hey stupid







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?117940-How-to-pronounce-Bjarne-Stroustrup&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Compiler for Linux

Newsgroup: comp.lang.c++

Subject: Compiler for Linux

From: "Paul ( The Troll )" <pchristor@...>

Date: Tue, 29 Oct 2013 12:05:26 -0700 (PDT)



Hi, What is the best compile for Ubuntu? I am downloading the QT Creator IDE, is it any good?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?117884-Compiler-for-Linux&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

can't get server socket working

Newsgroup: comp.lang.c++

Subject: can't get server socket working

From: cerr <ron.eggler@...>

Date: Tue, 29 Oct 2013 09:31:12 -0700 (PDT)



Hi,



I'm trying to get a server socket working but for some reason this doesn't allow any connections on 127.0.0.1:1234. What might be wrong here? No errors are being reported:



#include <iostream>

#include <unistd.h>

#include <stdlib.h>

#include <sys/types.h>

#include <sys/socket.h>

#include <netdb.h>

#include <string.h>

#include <stdio.h>



#define BUF_SIZE 500

using namespace std;



int getserversocket(int port);



int main (void)

{

socklen_t peer_addr_len;

ssize_t nread;

int sockhandle, s;

struct sockaddr_storage peer_addr;

char buf[BUF_SIZE];



cout << "MyServer 1.0" << endl;

if (sockhandle = getserversocket(1234) >= 0){

cout << "Socket created!" << endl;

} else {

cout << "Could not bind" << endl;

}

while(sockhandle >= 0) {

peer_addr_len = sizeof(struct sockaddr_storage);

nread = recvfrom(sockhandle, buf, BUF_SIZE, 0,

(struct sockaddr *) &peer_addr, &peer_addr_len);

if (nread == -1)

continue; /* Ignore failed request */



char host[NI_MAXHOST], service[NI_MAXSERV];



s = getnameinfo((struct sockaddr *) &peer_addr,

peer_addr_len, host, NI_MAXHOST,

service, NI_MAXSERV, NI_NUMERICSERV);

if (s == 0)

cout << "Received "<< (long)nread << "bytes from " << host << ":" << service << endl;

else

fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s));



if (sendto(sockhandle, buf, nread, 0,

(struct sockaddr *) &peer_addr,

peer_addr_len) != nread)

cout << "Error sending response" << endl;

}





}



int getserversocket(int port)

{

struct addrinfo hints;

struct addrinfo *result, *rp;

int addrinfo, sock;

char port_chr[5];

sprintf(port_chr,"%d",port);



memset(&hints, 0, sizeof(struct addrinfo));

hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */

hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */

hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */

hints.ai_protocol = 0; /* Any protocol */

hints.ai_canonname = NULL;

hints.ai_addr = NULL;

hints.ai_next = NULL;



addrinfo = getaddrinfo(NULL, port_chr, &hints, &result);

if (addrinfo != 0) {

fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(addrinfo));

exit(EXIT_FAILURE);

}



for (rp = result; rp != NULL; rp = rp->ai_next) {

sock = socket(rp->ai_family, rp->ai_socktype,

rp->ai_protocol);

if (sock == -1)

continue;



if (bind(sock, rp->ai_addr, rp->ai_addrlen) == 0)

break; /* Success */



close(sock);

}

freeaddrinfo(result); /* No longer needed */



if (rp == NULL) { /* No address succeeded */

return -1;

}

else

return sock;

}



Any assistance would be appreciated, Thank you!







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?117669-can-t-get-server-socket-working&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Monday, October 28, 2013

Template argument deduction

Newsgroup: comp.lang.c++

Subject: Template argument deduction

From: blaz.bratanic@...

Date: Mon, 28 Oct 2013 15:18:19 -0700 (PDT)



Would it be possible to rewrite the code below, to avoid explicit template argument specification?



#include <iostream>



struct A {

enum {

pass_by_reference = true

};



A() { std::cout << "A constructor." << std::endl; }

A(A const& other) { std::cout << "A copy constructor." << std::endl; }

void print() { std::cout << "Print A" << std::endl; }

};



struct B {

enum {

pass_by_reference = false

};



B() { std::cout << "B constructor." << std::endl; }

B(B const& other) { std::cout << "B copy constructor." << std::endl; }

void print() { std::cout << "Print B" << std::endl; }

};



template <bool B, class T> struct cond {

typedef T type;

};



template <class T> struct cond<true, T> {

typedef T& type;

};



template <typename T>

void foo(typename cond<T::pass_by_reference, T>::type a) {

a.print();

}



int main() {

A a;

B b;



foo<A>(a);

foo<B>(b);

}







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?117177-Template-argument-deduction&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Saturday, October 26, 2013

String class and the use of char*/const char*

Newsgroup: comp.lang.c++

Subject: String class and the use of char*/const char*

From: goran.pusic@...

Date: Wed, 23 Oct 2013 02:17:22 -0700 (PDT)



Hi all,



we seem to be having a style issue in the team.



We have a string class that has char* and const char* conversion operators

(yes, i know we should be using std::string, please bear with me).



Some people in the team prefer that, when calling code like this:



retval func(..., const char* param, ...);



with an instance of our string class, we use an explicit cast, e.g.



mystring s(whatever);

func(..., (const char*)s, ...);



(as opposed to not using a cast).



Can I please have your opinion on this (good/bad/like/not like)? Insight?

(My purpose, obviously, is to show your responses to the team).



TIA,



Goran.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?113796-String-class-and-the-use-of-char*-const-char*&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Friday, October 25, 2013

run .exe - Sublime Text

Newsgroup: comp.lang.c++

Subject: run .exe - Sublime Text

From: Egipicio <darkxteem@...>

Date: Fri, 25 Oct 2013 08:40:50 -0700 (PDT)



Hello, everybody.



The sublime is setting or plugin to run .exe(program) in the console?



Set up the cmd: C:\\Program Files (x86)\\CodeBlocks\\MinGW\\bin\\mingw32-g++.exe

Using MinGW that comes with CodeBlocks.



Thank you.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?115300-run-exe-Sublime-Text&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

const_cast member function pointer

Newsgroup: comp.lang.c++

Subject: const_cast member function pointer

From: nick.keighley.zczc@...

Date: Fri, 25 Oct 2013 02:49:25 -0700 (PDT)



Yes I read the FAQ! I'm not using a typedef as they don't seem to work with templates in C++98.





template<typename WB>

void EditProgramWizard::PopulateButton (MParameterButton* paramButton, WB* band,

int (WB::*read)(),

void (WB::*write)(int))

{

int (WB::*const_read)() = const_cast<int (WB::*)() const> (read);

PopulateButton (paramButton, band, const_read, write);

}



the cast fails with:



myprog.cpp: In member function ?void EditProgramWizard::PopulateButton(MParameterButton *, WB*, int (WB::*)(), void (WB::*)(int)) [with WB = WeightBand]?:

myprog.cpp:464:125: instantiated from here

myprog.cpp:1521:68: error: invalid use of const_cast with type ?int (WeightBand::*)()const?, which is not a pointer, reference, nor a pointer-to-data-member type



I was under the impression ?int (WeightBand::*)()const' *was* a pointer.



Oh. Are pointers to member functions not const castable?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?115142-const_cast-member-function-pointer&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Tuesday, October 22, 2013

A function returning an array

Newsgroup: comp.lang.c++

Subject: A function returning an array

From: axcytz@...

Date: Tue, 22 Oct 2013 18:22:38 -0700 (PDT)



Hi all,



If I have a 1D array and a function that returns this array, how do i do it?



Thanks!







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?113597-A-function-returning-an-array&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

2d array call in a function

Newsgroup: comp.lang.c++

Subject: 2d array call in a function

From: axcytz@...

Date: Tue, 22 Oct 2013 18:15:10 -0700 (PDT)



Hi all,



I have a 2d array that I declared as:



int array[3][3] ={{1,2,3},{1,3,5},{3,2,5}};

int InitialArray[3] = {..};

int Result;



I also use this in a function:



int Calculate(int myarray[], int array[][3], int result)

{

for(int i=0; i<3 ;i++)

{

for(int j=0; j<i+1 ;j++)

result += array[myarray[i]][myarray[j]];

}

}



In main, I call it as



Calculate(InitialArray, array, Result);



I get some errors because of the 2d array in function. How should i fix this?



expected primary-expression before â]â token

array bound is not an integer constant





Thanks in advance!







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?113596-2d-array-call-in-a-function&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

static function in named namespace

Newsgroup: comp.lang.c++

Subject: static function in named namespace

From: Yuanfang Chen <tabloid.adroit@...>

Date: Tue, 22 Oct 2013 12:49:36 -0700 (PDT)



Hi all,



I am confused by code like this



namespace foo {



static void bar() {...}



}



what's the purpose of static here?



best,

yuanfang







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?113370-static-function-in-named-namespace&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Monday, October 21, 2013

Follow-up Pimpl question

Newsgroup: comp.lang.c++

Subject: Follow-up Pimpl question

From: Rupert Swarbrick <rswarbrick@...>

Date: Mon, 21 Oct 2013 23:39:27 +0100



I'm coming back to writing some C++ after a few years in Lisp-land, and

was wondering about the "pimpl idiom". I understand how to write and use

it, and have done in the past. However, I don't really understand what

it gains you over having an abstract base class in the header, along

with a factory function.



Presumably there's a significant difference, since people put up with

the reams of boilerplate required for passing functions through to the

implementation object. Can anyone explain to me what it is?





Rupert





PS: I'm not sure whether there are strong feelings about whether to use

this idiom or not. To be clear, I'm not trying to hear them! I can

see obvious downsides to keeping a pointer to an implementation

object (verbosity; have to be careful about destructor +

exceptions...) and I'm interested to know what the upsides are.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112797-Follow-up-Pimpl-question&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

More C++ 11 questions regarding array

Newsgroup: comp.lang.c++

Subject: More C++ 11 questions regarding array

From: bobl0456@...

Date: Mon, 21 Oct 2013 12:35:43 -0700 (PDT)



Correct me if I am wrong, but there seems to be a least 2 short comings (at least to my view point) to using std::array :



1) no equivalent to



int myArray[] = { a very long list of values too long to conveniently count };



2) no equivalent to



void func (int[], int[][3] );



in other words, when converted to an std::array we need to specify the size of all of the dimensions of arrays passed to a function.



Am I correct on these 2 points? Or are there acceptable workarounds or syntax I am not aware of?



Thanks,

Bob







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112697-More-C-11-questions-regarding-array&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

scoped enum issue with MS VS C++

Newsgroup: comp.lang.c++

Subject: scoped enum issue with MS VS C++

From: bobl0456@...

Date: Mon, 21 Oct 2013 11:37:06 -0700 (PDT)



I get the following error:



TurtleGraphics.cpp(93): error C2677: binary '!=' : no global operator found which takes type 'Cmds' (or there is no acceptable conversion)



for the following statement:



} while ( cmdsArray[cmdNo] != Cmds::END_OF_DATA ); // repeat until end of data reached



Cmds is defined as:



enum class Cmds { PEN_UP = 1, PEN_DWN, TURN_RIGHT, TURN_LEFT, MOVE, DISPLAY, END_OF_DATA = 9};



and cmdsArray is a pointer based array of type int.



I do not understand why this should not work. BTW, I know that if I change the enum back to traditional unscoped enum it will work fine.



Bob











via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112677-scoped-enum-issue-with-MS-VS-C&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

And the mythical man month rears its ugly head again

Newsgroup: comp.lang.c++

Subject: And the mythical man month rears its ugly head again

From: Lynn McGuire <lmc@...>

Date: Mon, 21 Oct 2013 11:04:38 -0500



500 million lines of code?

http://www.nationalreview.com/corner/361743/healthcaregov-needs-five-million-code-lines-rewritten-andrew-johnson



Really? Really? I don't think so.



Lynn







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112630-And-the-mythical-man-month-rears-its-ugly-head-again&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

And the mythical man month rears it's upgly head again

Newsgroup: comp.lang.c++

Subject: And the mythical man month rears it's upgly head again

From: Lynn McGuire <lmc@...>

Date: Mon, 21 Oct 2013 11:02:18 -0500



500 million lines of code?

http://www.nationalreview.com/corner/361743/healthcaregov-needs-five-million-code-lines-rewritten-andrew-johnson



Really? Really? I don't think so.



Lynn







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112629-And-the-mythical-man-month-rears-it-s-upgly-head-again&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

A simpler Pimpl Idiom ?

Newsgroup: comp.lang.c++

Subject: A simpler Pimpl Idiom ?

From: mathieu <mathieu.malaterre@...>

Date: Mon, 21 Oct 2013 06:45:01 -0700 (PDT)



I have been reading "The Joy of Pimpls " [1], but this seems over-complicated IMHO. It requires a "back-pointer" just to split object in halves.



I am thinking of providing something similar (at least in my scenario), where I can hide the implementation completely.



I am thinking in something like this:



$ cat demo.cxx

// public stuff:

#include <iosfwd>



struct visible

{

public:

void print(std::ostream & os) const;

protected:

visible(){}

private:

visible(const visible &);

visible & operator = (const visible &);

};



visible * get_one();



// implementation details:

#include <iostream>



struct not_visible : public visible

{

public:

not_visible(int t, const char *v):tag(t),data(v){}

void print_impl(std::ostream & os) const

{

os << tag << " -> " << data << std::endl;

}

private:

int tag;

std::string data;

};



void visible::print(std::ostream & os) const

{

static_cast<const not_visible*>(this)->print_impl(os);

}



visible * get_one()

{

// dummy implementation just for the demo:

static not_visible v(123,"hello");

visible *ptr = &v;

return ptr;

}



int main()

{

visible *u = get_one();

u->print(std::cout);

return 0;

}





Does anyone sees anything wrong with this implementation ? How would one mark the class 'visible' an interface-only (it should not be derived in user applications).



Thanks,

-Mathieu



[1] http://www.gotw.ca/publications/mill05.htm







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112529-A-simpler-Pimpl-Idiom&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Question regarding copy constructor

Newsgroup: comp.lang.c++

Subject: Question regarding copy constructor

From: somenath <somenathpal@...>

Date: Sun, 20 Oct 2013 21:15:23 -0700 (PDT)



I have one question regarding the output of the following program.



#include<iostream>

using namespace std;



class A {

public:

A(int x) {

cout<<"Inside constructor A "<<endl;



}

A(const A&a) {

cout<<"Inside copy constructor";

}

void operator =( int x) {

cout<<"Inside assignment operator overloading "<<endl;

}

};

int main(void)

{

A a(2);

A a1 = 2;

A a2 = a;

return 0;

}

Output

+++++++++

Inside constructor A

Inside constructor A

Inside copy constructor



For this code

A a1 = 2;

I was expecting the copy constructor would be called. Because my understanding is compiler will create a temporary object using 2 and then that temporary object will be copied to a1 object. Something as follows.

__tempObj(2);

A a1 = __tempObj;

But that is not happening here . The copy constructor is not getting called. Where am I going wrong?

How the compiler then assigning 2 to object a1?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?112217-Question-regarding-copy-constructor&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Saturday, October 19, 2013

Sorting an STL map

Newsgroup: comp.lang.c++

Subject: Sorting an STL map

From: mrc2323@...

Date: Sat, 19 Oct 2013 14:58:59 -0700



I have implemented an STL map allowing me to store and update

information reasonably well...but I need to "dump" its contents in a

different order than it was built.. Specifically,



struct Fin_Struct

{ // Individual Finisher data

string finName; // Finisher Name (Last, First M.)

string finDoB; // (derived) DoB from event Age/Year

char finSex; // gender

int finishCount; // # Finishes by this participant

long finIdNum; // unique Finisher (link) Id

short finSrcCount; // Count of Source roots

} finWork;

typedef map<string, Fin_Struct> Fin_Type;

Fin_Type finMap;

Fin_Type::iterator finIter;



The map's key is the string "finName", and the incoming data sources

do not come into the program sorted by that field. Once the map is

populated (currently ~400,000 objects constructed from ~100 input

files), I need to write out the data in "key order". However, iterating

through the map doesn't produce the data from the entire data set in

that order. For example, if "Adams" is stored and updated after

"Baker" is first processed, "Adams" should come out before "Baker", etc.

- but it doesn't.

Ultimately, I want to output to be in name order, but since there's

no "map sort" I can't see how to accomplish this with the STL map. Is

there a way to do what I want, or is map the wrong container for my

application. (Please consider that the data volume is high, and the

bulk of the processing is in the storing/accumulating of the data set.)

Any thoughts? TIA







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?111683-Sorting-an-STL-map&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Thursday, October 17, 2013

C++ == Gagware?

Newsgroup: comp.lang.c++

Subject: Re: C++ == Gagware?

From: James Kanze <james.kanze@...>

Date: Thu, 17 Oct 2013 10:18:18 -0700 (PDT)



On Thursday, 8 July 1993 11:34:36 UTC+1, Jordan A. Bortz wrote:



> So I say -- you guys use it -- do you like it?



Not really, but I like most of the alternatives less.



> Is it productive?



Very.



> Can you read the code 6 months after you write it?



More so than in most languages. C++ is very expressive, which

means 1) it's simple to obfuscate, but 2) if you use it

correctly, the results are very readable. (More so, for

example, than Java.)



> Is it robust?



That is, I find, its strong point.



> Does it crash all the time?



No.



> Would you like a differnt

> object oriented c if it existed?



You mean like Objective-C? I've never actually tried it, but

from what little I saw, it doesn't tempt me.



> What about Smalltalk?



Not for the type of work I do. My applications have to work,

reliably, and (at least at present), they have to be fast.



> What do you use it for?



For a lot of things. In the past, I've mostly worked on large

scale servers, but I've done a complex order tracking system in

it, and I'm currently using it for numerically intensive

financial software.



> P.S. My personal feeling is, that for form based applications,

> you'd be better off with Smalltalk...



I don't know about Smalltalk, but for the user interface

front-end, you usually would be better off with a more dynamic

language. The code is normally very simple, with no real fixed

requirements (or they are constantly changing), and it doesn't

have to be very robust. In that context, I'll usually use

Python, rather than C++.



C++ shines (relative to the alternatives, at least) in larger

applications, where maintenance and robustness are critical.



> But there still is a need

> for C based Objects for device drivers, critical code, etc.

> But I think that those object-c programs need to be writable,

> readable, reusable, and maintainable, and I don't feel that C++ has any

> of those attributes.....despite being the "standard"



What you "feel" doesn't correspond with the reality of the

situation. C++ beats most of the languages out there for

readability, reusability and maintainability. (I've never used

modern Ada, but from what I hear, it's also very good in this

regard. Modula-3 was great, back then, but it hasn't evolved,

and it suffers from a serious lack of support.)



When it comes down to it, there are a lot of things I don't like

about C++ (like the syntax, for example), but all of the other

languages I know seem to be worse, at least for the type of work

I usually to.



--

James







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?110226-C-Gagware&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Testing C include file for C++ compatibility without a C++ caller?

Newsgroup: comp.lang.c++

Subject: Testing C include file for C++ compatibility without a C++ caller?

From: mathog <dmathog@...>

Date: Thu, 17 Oct 2013 10:09:54 -0700



I have a C package that until recently was callable by C++ programs

without generating warnings. Everything is properly wrapped up in



#ifdef __cplusplus

extern "C" {

#endif



which I always assumed precluded the possibility of a cleanly compiling

C module throwing warnings and errors when compiled by a C++ compiler.

However, recent versions of g++ throw warnings like this when some C++

modules include AND use one of the include files in the package:



../../src/extension/internal/metafile-print.cpp:132:13: warning:

narrowing conversion of ‘((color >> 16) & 255u)’ from ‘uint32_t

{aka unsigned int}’ to ‘uint8_t {aka unsigned char}’ inside { } is

ill-formed in C++11 [-Wnarrowing]



These trace back to this line in the include file:



#define U_RGBA(r,g,b,a) (U_COLORREF){r,g,b,a}



which must be changed to this to eliminate the warning:



#define U_RGBA(r,g,b,a)

(U_COLORREF){(uint8_t)(r), (uint8_t)(g), (uint8_t)(b), (uint8_t)(a)}



Where U_COLORREF is defined earlier in that include file as:



typedef struct {

uint8_t Red; //!< Red color (0-255)

uint8_t Green; //!< Green color (0-255)

uint8_t Blue; //!< Blue color (0-255)

uint8_t Reserved; //!< Not used

} U_COLORREF, *PU_COLORREF;



The problem is that so far the warning only shows up when the U_RGBA is

actually USED in a C++ module, apparently with a 4 byte unsigned

(holding a value in the range 0-255) employed as one of the color values.



I have the c++ compiler line that when applied to the cpp file generates

the error message, but when run exactly the same way, but just on the

include file, like:



g++ .... -c include.h



there are no warnings.



Is it possible to test for this sort of issue using just the C++

compiler and the include file? (Using gcc or g++).



Thank you,



David Mathog







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?110225-Testing-C-include-file-for-C-compatibility-without-a-C-caller&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Difficulties with binding to functions for semantic actions in a grammar

Newsgroup: comp.lang.c++

Subject: Difficulties with binding to functions for semantic actions in a grammar

From: Markus Elfring <Markus.Elfring@...>

Date: Thu, 17 Oct 2013 16:00:37 +0200



Hello,



I stumble on another challenge during the software development of a small

application which I derive from the Spirit tutorial on my openSUSE system.



http://sourceforge.net/mailarchive/message.php?msg_id=31489573





I observe that a source file is accepted by my compilers in one build

configuration. But error messages are displayed if I switch to the build

configuration where the relevant source code is directly included by header

files. Would you like to share any ideas on approaches to resolve this issue?



https://github.com/elfring/boot_parameters/blob/d65ffb55c0643aac8cb02126066252e898b12bf9/boost/CMakeLists.txt



Regards,

Markus







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?110131-Difficulties-with-binding-to-functions-for-semantic-actions-in-a-grammar&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Tuesday, October 15, 2013

Macro Expansion

Newsgroup: comp.lang.c++

Subject: Macro Expansion

From: Ryan <code@...>

Date: Tue, 15 Oct 2013 15:38:38 -0700 (PDT)



Below I have a series of defined macros. When ISVALID_TEST is called the compiler is complaining the macro doesn't have enough actual parameters. This means NOINPUT isn't expanding. The definition of ISVALID_TEST uses the UnitTest++ framework. This isn't an issue but unless you have it it won't compile. It is shown here to explain the macro signature.



How can I get NOINPUT to take the place of Kpos, Kvel and Kacc in the macro call instead of all being stuffed into Kpos?



Ryan





#define P99_PROTECT(...) __VA_ARGS__



#define NOINPUT P99PROTECT(false, false, false)



#define ISVALID_TEST(TestName, Kpos, Kvel, Kacc) \

TEST(TestName) \

{ \

point = std::make_shared<KinematicState>(); \

if (Kpos) point->set(position); \

}



//This line complains the macro doesn't have enough actual parameters

ISVALID_TEST(NoInput, NOINPUT);



//Works fine.

ISVALID_TEST(NoInput2, false, false, false);







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?108740-Macro-Expansion&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

String and interfacing with functions using char*

Newsgroup: comp.lang.c++

Subject: String and interfacing with functions using char*

From: DSF <notavalid@...>

Date: Mon, 14 Oct 2013 15:07:19 -0400



Hello,



This may be a question with an obvious answer, but I'm trying to

find out how to use a String object when it needs to be filled by a

function that uses char pointers. To make things simple, I'll use

strcpy as an example. It's properties are well known and should serve

better to explain than an obscure API call.



String cppstr = "Hello";

char cstr[20];



strcpy(cstr, cppstr.c_str());

...do whatever with cstr



I have no problem when the String is on the source side, but what if

it's on the destination side, too? Is something like this the only

recourse?



String cppstr1 = "Hello";

String cppstr2;

char *tempstr;



tempstr = new char["estimated size needed"];

strcpy(tempstr, cppstr.c_str());

cppstr2 = tempstr;

delete[] tempstr;

...do whatever with cppstr2



Or is there a way to get a C-type string directly into a String when

it's returned through a pointer as a parameter of a function? (And

no, unlike strcpy, the API call does not return the output C string

like strcpy does.)



DSF







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?107591-String-and-interfacing-with-functions-using-char*&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Saturday, October 12, 2013

RAII object in constructor

Newsgroup: comp.lang.c++

Subject: RAII object in constructor

From: =?ISO-8859-1?Q?Marcel_M=FCller?= <news.5.maazl@...>

Date: Wed, 09 Oct 2013 22:48:50 +0200



I have a mutex lock that is implemented as RAII. I need to acquire the

mutex as long as the constructor runs. But for the /entire/ constructor

run not just the construction of the derived class.





Example:



#include <stdio.h>



// some mutex class

class Mutex

{

public:

// hold the Mutex (RAII)

struct Lock

{ Lock(Mutex& mtx)

{ puts("Lock()\n");

//...

}

~Lock()

{ puts("~Lock()\n");

//...

}

};

//...

};



// set of configuration parameters

struct Parameters

{ //...

};



class WorkerBase

{ //...

protected:

WorkerBase(const Parameters& params)

{ // do something with params...

}

};



class Worker : public WorkerBase

{

private:

static Parameters GlobalParams;

static Mutex ParamMtx; // protect the above



public:

// synchronized public access to the parameters

struct AccessParams : Mutex::Lock

{ AccessParams() : Mutex::Lock(ParamMtx) {}

operator Parameters&() { return GlobalParams; }

};



Worker() : WorkerBase(AccessParams())

{ AccessParams params; // !!! Mutex acquired twice!

// do something with params...

}

};



Parameters Worker::GlobalParams;

Mutex Worker::ParamMtx;



int main()

{ Worker worker;

// do something with worker...

}





As expected the mutex is acquired twice. But this is bad, since the idea

is to sample a consistent set of parameters and not to use one parameter

set for the base class and some other one for the derived class.



Any ideas how to solve this?





Marcel







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?104289-RAII-object-in-constructor&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Tuesday, October 8, 2013

Copying part of a vector element to a string variable

Newsgroup: comp.lang.c++

Subject: Copying part of a vector element to a string variable

From: "Steph W." <swilks06@...>

Date: Mon, 7 Oct 2013 21:01:42 -0700 (PDT)



I know you can copy a vector to a string by using:



std::string t( v.begin(), v.end() );



But is it possible just to copy apart of a vector element to a string?



For instance if you have a vector that has the following:



S R A

F B 30

M A 49

F M 34



Each line would be an element and each char would be an element inside that element. So could take vector[1][4:5], which be the "30", and just put that into a string variable?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?102960-Copying-part-of-a-vector-element-to-a-string-variable&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Integer arithmetic when overflow exists

Newsgroup: comp.lang.c++

Subject: Integer arithmetic when overflow exists

From: junyangzou <zoujyjs@...>

Date: Mon, 7 Oct 2013 20:39:59 -0700 (PDT)



Tow 32 bit integer values A and B, are processed to give the 32 bit integers C and D as per the following rules. Which of the rule(s) is(are) reversible? i.e. is it possible to obtain A and B given c and D in all condition?



A. C = (int32)(A+B), D = (int32)(A-B)



B. C = (int32)(A+B), D= (int32)((A-B)>>1)



C. C = (int32)(A+B), D = B



D. C = (int32)(A+B), D = (int32)(A+2*B)



E. C = (int32)(A*B), D = (int32)(A/B)



A few questions about the integer arithmetic. Modular addition forms amathematical structure known as an abelian group. How about signed addition? It's also commutative (that?s where the ?abelian? part comes in) and associative, is this forms a n an abelian group?



Given that integer addition is commutative and associative, C is apparently true, because we can retrieve A by (A+(B-B)). What about D? Can we assume that 2 * B = B + B st. B = A+B+B-(A+B)?



And multiplication is more complicated, but I know that it can not be retrieve A if there is an overflow.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?102926-Integer-arithmetic-when-overflow-exists&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Monday, October 7, 2013

An Objective-C to C++ Translator

Newsgroup: comp.lang.c++

Subject: Re: An Objective-C to C++ Translator

From: lipingyang2010@...

Date: Mon, 7 Oct 2013 16:01:56 -0700 (PDT)



On Thursday, July 28, 1988 11:19:01 AM UTC-7, Jim Adcock wrote:

> I have an Objective-C to C++ "translation aid" that I'm willing to make

> available on an "unsupported public domain" basis to strongly motivated

> users.

>

> The translator reduces by maybe a factor of 10X the amount of time

> required to translate software from Objective-C to C++.

>

> Unlike some language translators, this one chooses not to do a flawless

> job of translating, but rather emphasizes not messing up the original

> naming conventions, indentations, and commenting schemes. This leaves

> some final manual clean up work to the user. On the positive side, the

> resulting code looks like real code, not some kind of gibberish.

>

> The potential user should have a fair chunk of code that needs to be

> translated -- say more than 10 classes, should be quite knowledgable in

> C++ and Objective-C, and should have some idea of the difficulties and

> limitations involved in language translation. The translator is implemented

> in K+R C code which should be relatively portable, but may take a day

> or two's work to get running on a new machine. Finally, the potential user

> should realize that using the translator is not going to be a very useful

> way to compare the relative merits of Objective-C and C++.

>

> This tool is not flawless, but has proven to be useful to some people.





That's what I am looking for. Can you share it?



thanks,







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?102812-An-Objective-C-to-C-Translator&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Friday, October 4, 2013

Hope for your project - a little off topic.

Newsgroup: comp.lang.c++

Subject: Re: Hope for your project - a little off topic.

From: woodbrian77@...

Date: Fri, 4 Oct 2013 15:08:44 -0700 (PDT)





Also I'll pay someone $100 cash and give them a $200

investment in my company if they help me find someone

to work with. The company rewards investments to 3

times their original amount. So you would receive

anywhere from $0 to $600 on the investment part,

depending on how things go for the company. I'll pay

the $100 cash after working with whomever it is for 4

months.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?101065-Hope-for-your-project-a-little-off-topic&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Shift elements of an array

Newsgroup: comp.lang.c++

Subject: Shift elements of an array

From: axcytz@...

Date: Thu, 3 Oct 2013 21:35:12 -0700 (PDT)



Hi all,



I have an array containing 15 elements. I want to shift the elements to the right and store the new array in another array, and keep the original array as is. Does anyone have any suggestions regarding this?



Thanks in advance







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?100498-Shift-elements-of-an-array&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

search name of the function at runtime

Newsgroup: comp.lang.c++

Subject: search name of the function at runtime

From: foice <franceschini.roberto@...>

Date: Thu, 3 Oct 2013 07:09:20 -0700 (PDT)



Hello,

I have a large .h file where many functions are defined. These functions are what the user calls at runtime to execute specific operations with my code. It's kind of tedious to remember the names of these functions and often even I have to go back to the source code to remember the exact name that I gave to these functions.



So, I was wondering that I can write a function that lists all the functions defined in a given .h file, maybe even filtering according to some regular expression.

The "search" must be doable at runtime without reading the source, if possible.



Thanks for helping,

Roberto







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?100080-search-name-of-the-function-at-runtime&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Thursday, October 3, 2013

A Better Choice?

Newsgroup: comp.lang.c++

Subject: A Better Choice?

From: mrc2323@...

Date: Sat, 28 Sep 2013 15:15:35 -0700



I have the following data declaration that is causing compiler

warnings:



char DBI[60001] = {'\0'} ;



The purpose of this data is to store a character value ('a'..'I') for

each corresponding record that has been read from a database. The

records are identified by a value that ranges from 1-60000. I can't use

a bitset here, as I need to store the character value associated with

each record. I don't want to be limited by the current supported range

(1...60000).

I'm looking for a better (STL container?) technique that might serve

my purpose but also avoid the fixed size constant declaration which is

causing compiler warnings. Also, I'm not especially concerned with

performance in this functionality. Any thoughts? TIA







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?96731-A-Better-Choice&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

Tuesday, October 1, 2013

why does this work with Visual C++ 2005?

Newsgroup: comp.lang.c++

Subject: why does this work with Visual C++ 2005?

From: Lynn McGuire <lmc@...>

Date: Mon, 30 Sep 2013 18:45:34 -0500



Why does this work with Visual C++ 2005?



char buffer [10000];

void * test5 = & buffer;



I would think the compiler would give an error

on "& buffer", because "buffer" is the memory

address of the first element in the array, and

you can't get a memory address of a memory

address, there is no such thing. Note that

test5 and buffer do point to the same memory

address in the VC++ debugger after execution of

that line of code.



We do get a compiler error on:



char * test3 = & buffer;



And the following code compiles correctly:



char * test4 = & buffer [0];



The only thing i can think is the compiler

treats "& buffer" as "& buffer [0]" in the

void * case, assuming that is what the

programmer wanted.



Thanks,

Lynn













via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?98099-why-does-this-work-with-Visual-C-2005&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

C++ Primer Front Cover?

Newsgroup: comp.lang.c++

Subject: C++ Primer Front Cover?

From: Michal Idziorek <idziorek@...>

Date: Sun, 29 Sep 2013 17:41:08 -0700 (PDT)



Hi everyone,



I am aware my question is heavily off-topic, but I just can not get it out of my mind:



What is that thing on the front cover of the C++ Primer (by Lippman et al.) ?

Animal bones?



I Hope somebody can tell.

Warm Regards and thanks in advance,

m.



Ref: http://cache1.bdcdn.net/assets/images/book/large/9780/3217/9780321714114.jpg









via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?97324-C-Primer-Front-Cover&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums