General C++ Programming - September 2014 (Page 4)

How can i unite 2 strings in array?
 
#include<iostream>; using namespace std; int strlen(char ); void strcat(char S1 , char S2 , int size_1, int size_2); const int SIZE = 100; const int MA...
[5 replies] Last: My blooper was pretty fundamental. (by closed account 48T7M4Gy)
BMI Calculator
 
I'm a beginner, so take it easy on me. My problem is in my output. If you put in a full name, it crashes. Should I have used something other than string? It co...
[1 reply] : Hi, The else cannot have a condition. Make it another else if , t... (by TheIdeasMan)
Avoiding construction of object fields
 
I have made the following code to illustrate my problem: #pragma once #include <bitset> #include <iostream> class ConstructTest { private: std::b...
[5 replies] Last: #include <bitset> #include <string> #include <iostream> class Constr... (by JLBorges)
Odd behaviour when reading file into vector.data()
 
I have the following code: #include <vector> #include <fstream> #include <iostream> #include <string> using namespace std; int main() { vector<strin...
[3 replies] Last: Now you're overflowing the vector's internal buffer. The size paramete... (by helios)
array's to the power
 
Hey all, so I am trying to make a code with one constant array and another in which I input the numbers then find a third array by doing the 1st*(second^2). ...
[2 replies] Last: yes you were absolutely right. but when I put power does that change ... (by ninjarun)
How to bubble sort data from a file?
 
I'm trying to write a program that will print the data of 10 records from a file and then, sort them descending to ascending by year. Here are the records: ...
[1 reply] : Have a class: class Student { string name; unsigned int year... (by n4nature)
c++ help
 
hi everyone im a beginner at c++ my goal here is to add all the aid together and also to use a call function besides main() heres my work, pls help thank ...
[no replies]
(!inFile.eof()) not reading last line?
 
So, I've been going at this all morning (just to let the people here know that I'm not one to just look for the answers an not do assignments myself). I'm ba...
[2 replies] Last: Thank you so much. Working now! (by collegecomp)
C++ help i need help with a program im trying to get to work
 
#include <iostream> #include <cmath> #include <iomanip> using namespace std; const double PI = 3.1416; // Student adds code for d...
[2 replies] Last: thanks but im still working on it and it still says there are errors i... (by damianbloch49)
Declaring a valarray of references?
 
Is it permissible to declare, for example, ` std::valarray<int&> `? If so, how do I initialize such if the ` valarray ` is a class member?
[3 replies] Last: std::reference_wrapper<> does not satisfy the requirements of a num... (by JLBorges)
by meshb
runtime error really need help here
 
hi all hope u r fine and good i got a problem here with this code and i need little help my problem that the program stops immediately with a close message to b...
[3 replies] Last: =D it works o.O did that change pointer .childrenNamenew=string[po... (by meshb)
Best way to emulate VGA and display?
 
I currently am working on getting my VGA emulation working. I have several functions in a jumptable for processing different 'signals': Vtotal Htotal Vretrace ...
[no replies]
by ephekt
typename error
 
this is probably something super simple; this line is generating the error im pretty sure it just needs 'typename' or 'Item' somewhere but i cant figure it ou...
[3 replies] Last: may be template <class Item> Item sequence<Item>::current() const ? ... (by fcantoro)
by Dasari
Virtual Constructors
 
Why don't we have virtual constructors in c++. Please give me the brief discussion on this topic.
[3 replies] Last: Plus: the virtual table is initialized from the constructor, hence a c... (by coder777)
by Pured
How would I implement this?
 
Hello, I have been trying multiple things and thinking for a while, but I just can't think of the correct syntax/logic for it. I have a base class and two deri...
[9 replies] Last: :-) (by closed account 48T7M4Gy)
template encounter empty array
 
I wrote a template function which use dynamic array as parameter. But if parameter is a empty array, it have compile error. code: #include <iostream> int...
[1 reply] : Well, it is logical as zero-length arrays are illegal in C++ [quote=St... (by MiiNiPaa)
Pass Address of pointer to function
 
#include <iostream> using namespace std; void myfunc(int* ); // what do i put in these parameters to accept a mem loc of a pointer int main () { int x =...
[3 replies] Last: I found out how to do it before anybody replied so i figured I add the... (by novellof)
LNK2019 Error
 
I'm fairly new to C++ and I've been having an LNK error without knowing what to do. I've listed the code, class file and errors below. I have the header as Re...
[2 replies] Last: Thanks, I actually figured out that I way over-thought this and the so... (by trippyimagez)
Chess Help needed!
 
some parts of this program are faulty. It runs and compiles just fine but the king can't be checkmated and the words on pieces start dissapearing after the king...
[no replies]
How to see the actual size of a PTR?
 
How can I see the actual byte size of the pointer as output in the command prompt? #include <iostream> using namespace std; int main () { int x = 5; ...
[2 replies] Last: Awesome thanks! (by novellof)
September 2014 Pages: 123456... 28
  Archived months: [aug2014] [oct2014]

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