General C++ Programming - January 2015 (Page 13)

character array
 
guys i have a problem i cant find a way to count how many times a character occur in a character array the out put should be a=2 b=1 but my output is a=2 b=1 a...
[2 replies] Last: yes its working sujitnag. thankx (by meagouph)
Puzzling Valgrind error report on InValid Free
 
I have a class as follows: class myClass { double x=0; double y =0; public: std::vector<double> xpoint1, xpoint2, ypoint1, ypoint2; void foo(...
[4 replies] Last: Thanks kevinkjt2000, you were correct. The passed vectors were part o... (by DexterMorgan)
Equation Class
 
So I have a new project for myself. I want to create an equation class in c++. I created one in python using lambda expressions but I'm curious how tht would be...
[3 replies] Last: I need an equation class so I can write functions that can take deriva... (by cmajor28)
Using gdb to detect segmentation fault in sh?
 
I am using scientific linux. In the directory user/project/Build, after I ran 'make' to compile and link all the cpp files,I had no problems. But then, when I w...
[2 replies] Last: When I then use the command prompt to go into directory /user/project... (by larry burns)
Divide an array into multiple arrays
 
Hey guys, I am trying to do this: Read a text file which is like: 2 2 10 1 2 7 3 8 3 7 7 10 7 The first line indicates how many paths exist in my ...
[4 replies] Last: Thank you! That's exactly what I needed :) (by shahin90)
Trying to understand destructors
 
I have been reading up on destuctors and what I have been reading says that the destructor is automatically called by the compiler as soon as the scope of the o...
[5 replies] Last: You're right I was looking at it all wrong. That explanation helped a ... (by retroCheck)
by saim
please complete this programe for me
 
write a menu driven program that do following. using (functions) in 2D array? press 1 to enter array elements. press 2 to add the array elements . pre...
[3 replies] Last: LOL computergeek, with a simple task like that, anyone would do it. y... (by axtyax)
index violation?
 
Please see some sample code at http://sourcemaking.com/design_patterns/flyweight/cpp/2 This is an example of the flyweight design pattern. I realize, the mai...
[3 replies] Last: . I recall seeing exceptions triggered in such cases It was probably ... (by MiiNiPaa)
Fixing logic errors
 
Hello. This is a program for blackjack in C++. Most of the needed parts are in here like a normal program, but there are a lot of logic errors I do not know how...
[2 replies] Last: As of your first question. My function void card(int card) is used to ... (by DerpOverlord)
union related q?
 
how to find out which member of union is currently set/active. exm: union myunion{ int i; float f; } if i set myunion ob{7}, it set ob.i=7; my ...
[2 replies] Last: Or, create a structure that contains both the identifier and the union... (by doug4)
by Gyiove
messing with function(...), need help!
 
Hello everyone! void myfunc( ... ) { // 1. i need to get somehow the count of variables passed into myfunc // 2. i need to know their size ( ch...
[1 reply] : I would take a look at this c++11 answer here: http://stackoverflow.co... (by kevinkjt2000)
Server Team
 
Hey guys First I'd like to introduce myself. I am 17 years old, and been around servers for awhile now, well a server/game/mmorpg called Endless Online. I'm ...
[4 replies] Last: Sure thing, here is some links. 1) Main Server/Game -http://endless-... (by Camouflage)
Fill array with other array question
 
Hello all, I ave a more or an efficiency question, I have an array of pixels now the array is built up like this unsigned char* blue = new unsigned char...
[4 replies] Last: Again, lines 13-19 can be replaced by std::vector<std::vector<std::ve... (by MiiNiPaa)
by Jt253
Search Function for the Speaker's Bureau Program
 
Hey guys, I'm working on this program for homework an here is the problem: Write a program that keeps track of a speakers bureau. The program should use a...
[4 replies] Last: My professor actualy wants me to use linear search or binary search. S... (by Jt253)
Why assign a pointer to an array?
 
Why would you ever assign a pointer to an existing array? Take this link for example. Why would you ever do this?: http://www.tutorialspoint.com/cprogramming/...
[3 replies] Last: Actually, iterators are modeled after pointers. That's why they look s... (by Duthomhas)
List Initialized Vector is having error messages
 
vector<int> vec1 {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}; This code worked perfectly fine in Xcode earlier today, but when I got home on visual studio 2012 expr...
[2 replies] Last: I'll download it then. Thanks for the fast response. Much appreciated. (by Vesparo)
simple program switch statement
 
i've been making simple programs for practice. i am stuck on something easy lol. I made a simple program with a switch statement asking to add delete and edit p...
[2 replies] Last: instead of while i used do while loop and it worked but i would like t... (by aslantek87)
Why is private member template accessible outside class?
 
Hi, I just happened to find that a nested private template class can be accessed directly outside the enclosing class using a using alias: namespace ns { ...
[2 replies] Last: namespace ns { class wrapper { private: ... (by JLBorges)
Update() function in game engine, how to call it?
 
Hi guys, I'm trying to build a game engine but I'm stuck at this point: I don't see a way to call my "update" method. I've been thinking about a parent class wi...
[11 replies] Last: Yes... The update function needs to be called. The reason why your me... (by Avilius)
Program that determines number of inputted riders and closes when -1 is inputted?
 
As the title says, I seem to be having a logical error but can not find the sources. #include <iostream> using namespace std; int main() { int s...
[1 reply] : What did you intend this piece of code to accomplish? You have a for ... (by kevinkjt2000)
January 2015 Pages: 1... 1112131415... 24
  Archived months: [dec2014] [feb2015]

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