General C++ Programming - November 2014 (Page 28)

When initializing wchar_t* data-members.
 
Is it generally better to initialize string data members as nullptr or as a zero-size array? I can understand the former is superior from a memory-use perspe...
[4 replies] Last: Lolzor!!! But you are talking about the standard library string class... (by Gemman Aster)
Help with the c++ code
 
++Hello guys, I wrote this code to solve 2d heat diffusion problem by finite difference method. The code is compiling(generic compiler,ubuntu) and running fine...
[no replies]
HELP! Mouse maze
 
I am currently working on a group project ,and we are stumped on how to implement a mouse that can move through the maze we have coded. The goal is to create a ...
[1 reply] : I have to get back to work so I will give you the short answer for now... (by primem0ver)
by smosh
Help with Lab!
 
This is my lab: (A treasure is hidden someplace ! The coordinates (x1,y1) are determined randomly, using the code that is listed at the end of this lab. The...
[1 reply] : Inside the loop, you have to keep track of the current location of the... (by OffByOne)
Why is the output of the program 1?
 
Why is the output of the program 1? // Example program #include <iostream> using namespace std; int srt() { for(int i=1;i<=5;i++) { r...
[1 reply] : When you return you're exiting the function and returning that value. ... (by closed account 2UD8vCM9)
Struct Question
 
So I've been taking C++ classes (3rd semester in school) and I have yet to come across an answer to this. We seem to be leaving the struct section of this class...
[5 replies] Last: Even in C, you can initialize structures when they are created: Sped... (by OffByOne)
No matching function for call to [class]
 
Hey there guys. I'm having this pain in the ass error (No matching function for call to Data::Data() ) on this block of code: Etapa::Etapa(string nm, flo...
[2 replies] Last: I would guess that you have the default constructor of your Data class... (by Norm Gunderson)
pointer to array
 
#include<iostream> using namespace std; int main() { int *p,*q,a ={5,7,8,2}; p=a; int b ={3,5,2,4}; q=b; int e=p-q; cout<<e; ...
[2 replies] Last: no (by sajid dayer)
string vs wide string hashcode time
 
I have a "basic" question about the time it takes to compute a hash code for strings because Qt doesn't have support for single byte wide hash code calculation ...
[10 replies] Last: I am sorry about being condescending. I was just very surprised that ... (by primem0ver)
Can I have a class member variable that points to a function in another class?
 
The goal to create a button class that holds the function that is supposed to be invoked in another class when the button is clicked in a member variable. This...
[2 replies] Last: Thanks for answering this question.... I had decided to ask it in the ... (by primem0ver)
Creating a Map
 
So I was assigned a code to make a map using structs and pointers. Can't use classes yet but I thought I had a pretty good thing going. When I submit my program...
[no replies]
c++ restaurant menu
 
this is what i have done for the restaurant menu on c++ . #include <iostream> #include <cctype> #include <cstdlib> #include <iomanip> using namespac...
[1 reply] : what should i do if i would like to print the total price? Amountof... (by Konstantin2)
No operator ">>" matches these operands
 
I'm making a program that basically takes a first name, last name, and a players team of ten baseball players with five stats each and putting them into a spot ...
[3 replies] Last: indeed. OP you either want a collection of baseballPlayerdatabase obje... (by mutexe)
divRemain(); returns nDivides( / ) and nRemainder( % )
 
Hey there, I'm trying to run tests on the speed and efficiency of my function. It's called divRemain() and it's purpose is to take a dividend, an empty int,...
[3 replies] Last: #include <stdlib.h> #include <stdio.h> int main() { div_t d... (by kbw)
Why does SFINAE not work here - c++11
 
struct I_Have_No_Value; struct I_Have_Value { static const int value {};}; template<typename T> struct Error {static const int value {T::value};}; template<in...
[4 replies] Last: thanks a ton ! Marking it solved. (by ustulation)
im stuck
 
Hey guys im experimenting on void recursive function, and i dont understand why the ouput of this program is {1 2 1 3 1 2 1 } because the next number to 3...
[2 replies] Last: sorry (by theposibility)
Help
 
So I'm doing an assignment over a 1942 replica and I've encountered an issue where I have to get the score to go up, this is what I have so far. Game1.c...
[1 reply] : cs implies c#. You'd be better off finding a c# forum mate, for exampl... (by mutexe)
by anup30
waiting program
 
this program waits 3 sec. the problem is that it continues to use 100% of one CPU thread. How to wait without using CPU ? // wait zzzzz #include <iostream> ...
[6 replies] Last: i found another example from http://www.cplusplus.com/forum/beginner/1... (by anup30)
Problem with 3 lines of code, a simple problem?
 
Hey everyone, so this is my first post, kind of made it because I needed some help with this program, everything is here. The entire shell of the program is p...
[4 replies] Last: If head is NULL, you need to create a new node first. if (h... (by AndyMc)
Bank Sim SQL
 
Hi I've built a bank simulator just using an empty project and a .cpp file to write my code. What I want to be able to do is to be able to write all that inf...
[5 replies] Last: Did you add the sqlite3.c file to your project? http://www.sqlite.o... (by coder777)
November 2014 Pages: 1... 2627282930... 32
  Archived months: [oct2014] [dec2014]

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