General C++ Programming - May 2013 (Page 43)

Deriving base class
 
Can someone give me an example of how to create a base class that is derived (inherited) by three other classes? Thanks
[12 replies] Last: Thanks, that helped out a lot! (by t2nator)
Dynamic memory question
 
What is the diff between pscobject = new _pscmain; and _pscmain * pscobject ? For dynamic memory we need to deal with pointer. So to initinialize pointer i...
[2 replies] Last: Understood :) (by jaden5165)
Faster vs Smaller
 
Hello, I was wondering. I am a bit curious about this code: #include <iostream> int main (void) { /* faster */ struct big { int x; int y; int z; }...
[7 replies] Last: Does &0xF mean that it is only taking the lower 4 bits from a byte? S... (by helios)
Find String help
 
I'm trying to use the find string to erase a '\n' from the end of a word. I tried something along the lines of: if (SecondSide.find('\n')!= string::npos) ...
[7 replies] Last: ut it had no effect. Any suggestions on what I'm doing wrong? It d... (by cire)
Including a JPEG file
 
How to include a jpeg file into a c++ program??
[2 replies] Last: Do you mean embedding into executable itself and access it at runtime ... (by modoran)
No operator matches this operan
 
Im almost done with this code,, this is what i have to do Write a program that displays the roman numeral equivalent of any decimal number between 1 and 20 th...
[3 replies] Last: Thank you guys! it worked! (by Christian Feliciano)
Why doesn't it run in Release mode?
 
I've been working on the Euler project problems, and I have the solution to problem 25, but it only runs in debug mode, if I try to run in release mode then it ...
[4 replies] Last: If you want to see which warnings are generated (that warning is one ... (by Ikaron)
Ranking Problem With Arrays
 
At a contest, a team (3 – 4 members) is given one computer and a set amount of time (typically 4 – 5 hours) to write programs which solve a set of problems ...
[no replies]
Array into function as parameter pass
 
Hey everyone, so I have been working on this all day, and its due in like an hour and a half. I have done everything the program wants except the last part. Her...
[1 reply] : Your functions should be outside of main. Forward declarations are d... (by Computergeek01)
by Smac89
data corruption in vector
 
I have this code that is supposed to store numbers in one vector and another vector stores pointers to the values in the first vector: #include <iostream> #in...
[9 replies] Last: well then for-loops it is. thank you both (by Smac89)
C++ catching strings
 
I am making a very basic calculator, but the problem is that when I input a string, it goes on repeating itself infinitely. Any help?
[10 replies] Last: Normally cout is "tied" to cin. Whenever you use cin, cout is flushed... (by cire)
Issue with function
 
void add_inventory(string item){ int x; //Counter while (x << bag_space){ //While counter is lower than bagspace if (inventory == "Empty") {inventory ...
[2 replies] Last: Alright that makes sense. I read somewhere about using inventory .com... (by Nathaniel Sheller)
threads : variable allocated on the stack is persisting
 
I always thought variables allocated on the stack vanish when the function returns / ends However, using threads, I am seeing my variables persist // I o...
[8 replies] Last: No. They are part of the static data area of the program, which exist... (by MikeyBoy)
converting a double to a string
 
hi i think i need to convert a double to a string, we are working in visual studio doing a program. when i run the calculator i'm not getting the answer i need ...
[1 reply] : never mind i figured it out that quick, i had area as int and i was di... (by latenwrong)
Returning A Different Data Type Depending On A Variable
 
Okay, I've been working on this Texture class that's going to be compatible with both SDL and OpenGL with the capability to create an array of textures within o...
[4 replies] Last: @ OP: Have you looked at the template tutorial here? It's how I learne... (by Computergeek01)
check if number belongs to particular base or not
 
i am making a number base conversion program in c++, suppose that user enters an base 2 number and want to convert that number in base 4. when he enter the num...
[6 replies] Last: how can i detect that number is belongs to base 2 number system or no... (by cire)
if statement doesn't work as I expected
 
#include "stdafx.h" #include <iostream> using namespace std; int main() { int a,b; b = 2; cout << "Please enter integer in range of –2,147,483...
[6 replies] Last: Pardon me so why it's not working for me ? You're using VC++ which... (by cire)
by CroCo
Winsock & double in C?
 
Hello all, I'm trying to send a double array using UDP over the Internet. I did establish the connection between Client/Server and I sent char data in Winsock...
[1 reply] : Thank you. I did figure it out. (by CroCo)
Getting bug: 'first defined here'
 
while using codeblocks to compile, I get the errors Multiple definition of main and first defined here These are in the area where int main() ...
[8 replies] Last: Better yet, start a new, clean project. Make sure it is a "command lin... (by Duthomhas)
Problem with members initialisers
 
Hey, i was practicing member intialisers.. But I am being accused by the compiler for not declaring my class :p . I was actually accesing my class from another ...
[3 replies] Last: where is the object "so", line 9 in main.cpp (by Bourgond Aries)
May 2013 Pages: 1... 4142434445... 47
  Archived months: [apr2013] [jun2013]

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