General C++ Programming - April 2010 (Page 21)

difference between encapsulation and data hiding
 
Can anybody tell me what is the difference between encapsulation and data hiding with example? dun need the bookish one.
[1 reply] : Encapsulation means to protect sensitive information in an object by m... (by Disch)
sorting the data of Map
 
How to sort the data of map?.As we can sort the data of the vector by using the standard sort function. Is there similar way through which we can sort the data ...
[1 reply] : http://www.cplusplus.com/reference/stl/map/ Internally, the elements... (by R0mai)
Linked lists
 
I need to write a program to concatenate two linked lists. I have to include functions to: - create the two lists - display each list - concatenate the t...
[3 replies] Last: Mistake here(line 69): current->data2=a; All nodes in 2nd li... (by boolivar)
problem when copying with inheritance
 
Hi, I have some class in my program, like class A and class B. B is derived from A, like: class A { public: int x; }; class B : public A { pub...
[8 replies] Last: The specific problem here is that printStuff should take a reference o... (by kempofighter)
Same enum constant name in different enums
 
If I'm not mistaken, it's an error to have two enums in the same scope with constants having the same name but different values: enum E1 { C1=45, C2=4...
[2 replies] Last: Also check this out: #include <iostream> using namespace std; ... (by m4ster r0shi)
Banking class with file i/o
 
I have built a banking class, not fully done, but in the beginning stages, but I have come across a problem. I cant read the parts of the file I need and print ...
[4 replies] Last: It definitely does. Thanks much! Really appreciate it Maikel (by ingenioushax)
by chee
friend/method functions
 
i'm trying to use the method friends in this class 3...here is the error im getting. Error 2316 112: 'Host3::seeData(Class3)' is not a member of 'Host3' ...
[1 reply] : You're missing the return type. (by jsmith)
Array of Array?
 
It's been a while since I've programmed in C++ but the need has risen. I am programming a simple program that will search a Database, iterate through the resu...
[2 replies] Last: You want Boost::Any for this... (by choisum)
Linked List
 
Hello Everyone! I am attempting to write a function that searches a linked list for a value that the user enters. However, the problem I am running into with th...
[6 replies] Last: Thanks for all the help m4ster r0shi! (by ohsnap1319)
whats wrong here?
 
#include<iostream> what do you think is wrong with this code? using namespace std; int main() { int number; char symbol; cout << "Enter...
[2 replies] Last: It makes more sense to use ignore than get, imo. (by tummychow)
problem with reading from files.
 
I have two files which basically look like this: file1: 232 JOHN SMITH 3.4 34 H 345 ADAM SILVER 3.6 3 A file2: 232 4.0 S 2 Y 345 -3.0 M 4...
[1 reply] : After reading the last value on the second lines of your files, the eo... (by sammy34)
Size of the Class
 
Question1: I know the size of the Empty class is 1. Why is it so. Please explain it in details. Question2: class Base { private: int i; public: ...
[1 reply] : Question 1: because you can't have a type with a smaller size than a b... (by Bazzy)
How to choose between process core binding and thread core binding ?
 
If i have process P1 which contain two thread T1 and T2, then is it good to bind whole process to core C1 or To bind thread T1 to core C1 and T2 thread to C2 c...
[1 reply] : T1 to C1 and T2 to C2, ceteris paratus. It's unlikely to be worse than... (by choisum)
cannot find -lSDLmain
 
This is the error i am receiving compiling my code. I am using DEV C++. Here is the list of the parameters which i have used. " -lmingw32 -ISDL -lSDLmain -m...
[8 replies] Last: I really wish SDL used a better method for initialization than #defini... (by helios)
Deallocating memory with only the address of the data
 
I'm "reverse engineering" a game (Neverwinter Nights) as part of a project that hooks into the game process using madCodeHook.dll (www.nwnx.org) to provide func...
[9 replies] Last: Wouldn't that also mean that if I re-allocate the array there is a po... (by helios)
Read Multidimensional Array Constructor
 
I am writing a class FireWeatherWRF and i have a private declaration data_array that is called and initialised in my constructors. After I manipulate the data...
[10 replies] Last: Thanks all for your help. I worked with a different language when hand... (by stavros)
validating
 
This is part of a function for booking seats, can anyone show me how to handle the validation below.To make sure that a seat that has X cannot be booked again....
[1 reply] : I want you to notice the difference between the operators you use for ... (by m4ster r0shi)
counting numbers from a file
 
I am trying to count the Xs, Bs Is and Ws that exist in a file and output a summary of the count. ERROR: No error! the console window closed before any displ...
[4 replies] Last: As I said, your while loop makes no sense. 'ch = 'X'' has no effect o... (by hamsterman)
by sporx
finding the height of a Binary search tree
 
my code was working fine until i tried to implement the function to find the height of the tree. any idea where i messed up or a better way of doing this? i nee...
[3 replies] Last: b.height(&b); alternativly do an overload by: class Bin... (by maikel)
Using Arrays and learning Hexadecimal adder
 
I am to make a hexadecimal adder here is my question: I need help writing a hexadecimal adder. This is the question: Hexadecimal numerals are (integers writ...
[3 replies] Last: All of you for loops in this program should look like this: for(int i ... (by hamsterman)
April 2010 Pages: 1... 192021222324
  Archived months: [mar2010] [may2010]

This is an archived page. To post a new message, go to the current page.