General C++ Programming - August 2014 (Page 8)

Need help understanding or getting a function to work
 
This is just part of my current code, but I am struggling I guess typing correctly inside the for loop on the main function. Which I want it to go through the m...
[no replies]
How are c++ class objects stored in memory?
 
For example when I have: Class A{ B objectB; }; Now when I instantiate the object of class A like: main(){ A objectA;//option 1 A* pObjectA ...
[1 reply] : http://lmgtfy.com/?q=how+is+a+c%2B%2B+class+stored+in+memory (by tmason)
input twice
 
Hi, I am trying to figure out why whenever I input a number, I have to input it twice to go through the GetParam function. Example 1: (If I input a number l...
[3 replies] Last: Line 12 asks for the number and stores it in the double variable "numb... (by tmason)
Problem with function
 
Hi guys! Im a noob when it comes to C++ and recently i have some assignments to do. this is one of them: This question is based on contents covered in Chapte...
[no replies]
by LB
Return std::move by value or by rvalue-ref?
 
http://coliru.stacked-crooked.com/a/7ef314661039dbf3[code firstline=40]struct Test { Type t; auto stealA() -> Type { return std:...
[1 reply] : Must be stolen (forced): use prvalue. Can be stolen (caller has a choi... (by JLBorges)
by bonho
overloading operator[]
 
I have a class that acts like map<string, string>. However I want to execute some code when it sets an element. So class MyClass { public: long& ope...
[3 replies] Last: > Would you please explain a bit where line 15 gets called? Line 15 i... (by JLBorges)
Virtual function defined, how to define a destructor?
 
I wrote the following program, it can be compiled and run, but there is warning saying that if virtual function is defined, there should be a destructor. How to...
[1 reply] : #include <iostream> class cell_c { public: double p; ... (by JLBorges)
hi all~i need help~~
 
hi all~i am a newbie in using Visual C++. now i need to design a menue system for a customer data base to store ID number and names in a 20-element array; store...
[2 replies] Last: i just want to see some example~not asking you all help me do it~its o... (by bing3002)
Help me guys
 
#include<conio.h> #include<windows.h> #include<stdlib.h> #include<string.h> #include<time.h> #include <stdio.h> void loading(); void gotoxy(int ...
[no replies]
Expected identifier with numeric_limits
 
I'm trying to perform a simple input operation, and check to make sure that whatever the user input is a valid input (is within data type bounds, is correct dat...
[6 replies] Last: Works like a charm. Thanks guys :) (by Food 4 Thought)
buffer not writing to file
 
suddenly nothing is written to my file void taglessLine(char line ,ofstream& buffer){ buffer.open("buffer.txt", ios::out); int len=strlen(line...
[2 replies] Last: int i=0; while(i<len){ if (line =='<'){ ... (by dhayden)
Urgent help
 
Why are you fun with me? I ask you please give me the solution of object oriented programming with c++ by balaguruswamy and the solution of data structure by li...
[2 replies] Last: mdrocky, the point is that it's very unlikely that anyone here has the... (by dhayden)
by tmason
Speed of Basic Arrays Versus Vectors ...
 
Hello, A little exersize I did recently which essentially compares the speed of arrays versus vectors. I test the creation, usage, and deletion speeds of ...
[5 replies] Last: I wanted to measure usage of real world classes with constructors/des... (by dhayden)
by chhe
normal distribution
 
I wrote the following program shown below that produces a normally distributed random number several times, and then takes the average of them. The problem that...
[2 replies] Last: The default seed is usually no good. You can use std::time to seed the... (by Peter87)
Singleton implementation
 
I'm playing with the idea of a singleton base class, but I'm having an issue with how to implement the GetInstance() function in the base class. Since I'm tryi...
[12 replies] Last: dhayden, it's not a good idea to use static data members like that - t... (by LB)
Question regarding returning an std::weak_ptr vs std::shared_ptr
 
So as the title suggests I was wondering about the different cases where it would be preferable to return a std::weak_ptr over a std::shared_ptr. What brought...
[3 replies] Last: std::weak_ptr models temporary ownership: when an object needs to b... (by JLBorges)
getline skipping first line
 
text file is hello there void readFile(char , ifstream&); address records ; int main(){ char xml ; cout<<"Enter file name "; cin.getline(xml,...
[6 replies] Last: You can check by opening a terminal and typing od -c foo.txt (repl... (by Duthomhas)
Better way of doing this?
 
I am wondering if their is a better way to do this void ItemHandler::addGroundItem(unsigned short itemId, unsigned short x, unsigned short y, unsigned short...
[6 replies] Last: It looks like item_drops is a vector. The way you're using it here, ... (by dhayden)
by god657
Airport Simulation NEed Help!!
 
HI! I am a beginner for C++. I need help for an airport simulation where user can add, delete and edit the arrival board various times. Any simple solutions? w...
[no replies]
Solution
 
Anyone can give me a link the solution of object oriented programming with c++ by balaguruswamy and thd solution of data structures by lipschutz
[2 replies] Last: Please give current link (by mdrocky)
August 2014 Pages: 1... 678910... 25
  Archived months: [jul2014] [sep2014]

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