Hi, I am trying to learn OOP with c++ with the help of Turbo C++ version 3.0 and "C++ Primer Plus" by stephen prata. according to the book, the NEW convention for including the iostream header file in c++ is in the following way: #include<iostream> but it causes an error saying : unable to open include file "IOSTREAM" however the following code works: #include<iostream.h> but it is supposed to be the OLD convention Moreover , according to the book, it is necessary to use the following: using namespace std so that we can use cout and cin directly without having …

Member Avatar
Member Avatar
+0 forum 6

Hi I got a problem with converting from LPARAM to std::string. What I do is getting the selected object from a Listbox, the example I found on how to do this is to convert the object to LPARAM. Now I want to convert this LPARAM to std::string and I've tried three different ways, can't remember which three. But havent fully worked. How can I do it?

Member Avatar
Member Avatar
+0 forum 2

the program is about Blob<T>, where shared_ptr<std::vector<T> > as its data members. be noted that the real problem here is about shared_ptr of my own version (simple one) but atleast (should) worked with the Blob<T>, which is the std::shared_ptr did, but not with mine. [Error Msg](http://postimg.org/image/krwflmyhx/) the error msg above is produced through object that's being constructed by initializer list. if the object being constructed through default constructor then being append by push_back() function. the program compile but crashed. just after the shared_ptr::operator*() executed.yet I still unable to figure out the problems. T& operator*() const { return *p; } T* …

Member Avatar
Member Avatar
+0 forum 7

Hello everyone! I am having a bit of an odd problem here. So, on my Visual Studio project, I decided to use a precompiled header. This didn't seem to cause a noticable problem up until today. I have a small segment of code that is supposed to remove one element of a vector based on it's contents: using namespace std; . . . vector<int> v; v.push_back(4); v.push_back(5); v.push_back(6); v.push_back(7); v.erase(std::remove(v.begin(), v.end(), 6), v.end()); This USUALLY works. However, Visual Studio kept griping at me about how the synax is incorrect. So, I right-clicked on the remove function and found it's definition …

Member Avatar
Member Avatar
+0 forum 2

I am trying to find a bug in my new and (theoretically) improved syntax highlighter program. I have made 3 versions now and have been able to debug them all with ease. Unfortunately my debugger does not do well with std containers as it shows ALL the information they contain and it can be hard to sift through it to find errors. Can anybody see where I went wrong in this code? evenBetterMain.cpp: (since I already have main.cpp and betterMain.cpp working :P) [CODE]#include <iostream> //for cin/cout #include <string> //for std::strings, obviously #include <fstream> //for file operations #include <stdio.h> //for integer …

Member Avatar
Member Avatar
+0 forum 8

What is "std" and "::" .Like for example, std::cout. Now i know what is cout for but what is std and what are these "::" for?

Member Avatar
Member Avatar
+0 forum 8

Hi, i'm not very good at OOP, basically just started it. My program basically its like a system for a game shop, the main isn't fully done yet, however main isn't a problem. The other files must contain some kind of problem in them. Well enough of the talk, I'll show the code and hope someone from you, the proper programmers comparying to me. The thing is that I keep getting this error and not knowing how to fix it. \string.h:24, from game.cpp /string.h:24, from game.cpp \stddef.h extraneous `int' ignored \stddef.h long, short, signed or unsigned invalid for `size_t' \Makefile.win …

Member Avatar
Member Avatar
+0 forum 5

Hello I want to pass a bidimensional vector to the constructor of all instances of [ICODE]MyClass[/ICODE]. All instances must use and share and modify the same vector. And I want to keep a reference to that [ICODE]main_vector[/ICODE] to use it later in the program I am passing it by reference to MyClass. The problem is that when I assign it to [ICODE]ref_to_main_vector[/ICODE] to use it later, I'm not saving the reference but creating a duplicate of it, so each instances has its own copy. How can I make them all share the same variable? I'm not interested in passing it …

Member Avatar
Member Avatar
+0 forum 7

Hi, I have a map of a base class object (not pointer to objects). I did this because I need to have inheritance from others types like this: Parameter RealParameter: Parameter IntParameter: Parameter ... My problem is that when I am going to insert in the map, copy constructur of the base class is called, but really Parameter is only an class with all virtual methods, and all data is in the derived class. How can I develope a copy constructor of a base case class that allows me to copy his derived class associated? thanks all!

Member Avatar
Member Avatar
+0 forum 2

i want correct usage of it

Member Avatar
Member Avatar
+0 forum 3

The End.