General C++ Programming - February 2011 (Page 10)

tricky FUNCTION CALL
 
I am trying to build an passing array for row major order. The client file has function call like this Matrix a(3, 4, (matrixData ) {1, 2, 3, 4, 5, 6, 7, ...
[1 reply] : You have a matrix 1 5 9 2 6 10 3 7 11 4 8 12 in column major orde... (by hamsterman)
Type duplicate symbol player::player()in
 
Hey everyone! This is my first post in these forums so hello to all of you! :). I'm a newcomer to c++ and I've been having problems with seperating class dec...
[3 replies] Last: Ahh thanks guys. I can't believe it was such a simple mistake. I'll lo... (by cloudarchitect)
Not decleared in this scope
 
Hey all, i have this script for educational use only and there is a few issues i am having with not delceard in this scope: #include <iostream> using namespac...
[2 replies] Last: Please include #include <cstdio> or #include <stdio.h> you need... (by richardforc)
loop c++ : whats missing in this code?
 
the problem is : write a program that would generate the output below : * ** *** **** ***** ****** ***** **** *** ** * note : use only 1 pri...
[4 replies] Last: Haha that is very nice rocketboy! (by NickPaul)
Removing values from Array
 
A program I am working on requires that I removed zeroed-out values (along with their indices) from an array. ex. A=[12, 2, 7, 0, 3] ---> A=[12, 2, 7, 3] ...
[2 replies] Last: Normally, one would use std::vector and std::remove: http://www.cpl... (by Athar)
Please please please :::how I can calculate the excution time in C++
 
Hi; I want a function that calculate the excuation time in C++ my program is : Device an algorithm to determine the distance between the two points tha...
[1 reply] : You can use clock() to measure execution time in clocks. CLOCKS_PER_SE... (by Athar)
What is wrong with this copy constructor?
 
Ok so everything in this program works except for the copy constructor when I test it. When I run the program it segmentation faults. Copy constructor: te...
[8 replies] Last: Ah, good. Glad you fixed it. (by firedraco)
Direct3D Wrapper
 
I was thinking about making a wrapper library( if you want to call it that ) for Direct3D. I Just wanted to know, is it worth doing? Why? - Reusable - Si...
[1 reply] : It's reasonable to wrap C APIs so you can use them more naturally in C... (by Athar)
symbols not defined
 
I'm trying to use this library ssem.h and sshm.h, but I'm getting the following error message: % g++ -o Proc1 Proc1.C ssem.o sshm.o Undefined ...
[1 reply] : Problem fixed. I accidently copied the wrong file in my directory usin... (by dunsondog109)
Changing states
 
I am making a gaming engine (of sorts) I decided to implement a system where I can add "States" so I have a class "State": State.h class State { public: ...
[1 reply] : You need to work with pointers ;) #include <iostream> #include <v... (by m4ster r0shi)
Problem with #include and virtual functions
 
I have a class called object that includes a object of a class called attribute. Attribute, however, uses class object pointer's in some of its function defin...
[2 replies] Last: Object.h needs to include Attribute.h. Attribute.h can forward declar... (by jsmith)
Clearing out pipes
 
Hey guys I'm writing a program that reads input from a file then searches for a number in that file. It has to do the searching in its child processes and the i...
[3 replies] Last: Not with just the pipe; you'd need another synchronization mechanism ... (by jsmith)
Sample midterm problems, class functions
 
I have a midterm tomorrow and our professor gave us a sample midterm. I somewhat know how to do these 2 problems (they are intertwined), but I would like to kno...
[3 replies] Last: Not "going to". he most probably "has". (by rocketboy9000)
Do I need to lock static constants of a class in a multithreaded program?
 
Q1) Do I need to lock static constants of a class like string::npos that is accessed by multiple threads in a multithreaded program? Q2) If I have a function...
[6 replies] Last: @Zaita: Question 1 dealt with static constants. It's pretty clear fro... (by PanGalactic)
Creating a usable Executable on another computer
 
Hi, I just recently learned that an executable file is created simply by building my c++ program in either debug/release mode. I am using visual studio. My p...
[3 replies] Last: bartoli - thank you. I prefer to have the libraries statically linked ... (by readysetgo)
by firix
iterator class
 
Hi, I've written the source code vector and list. I would like to write the iterator class for these classes 1 2 3 4 5 template <class T class ...
[no replies]
Array not being modified by function call
 
Hello, I can't find anything explaining why this would be happening, so I implore this community. I've written a simple enough function to modify an array, nor...
[4 replies] Last: Nailed it, stupid mistake, thanks. (by bewers2)
A string problem.
 
I'm making a text adventure engine. I want to use strings in the class and I think I'm leaving a lib out or something. Here's the code: #include <iostream...
[5 replies] Last: OH WOW Thank you... That made so much sense! Lol. (by HeWasLikeAGhost)
Auto_ptr deallocating object because of an unconstructed object
 
Hi, I have the following piece of code - foo(Auto_ptr<A> autop1){ Auto_ptr<B>autop2(new B(10, autop1, 40)); // some code autop1.callFunc(); >>>...
[5 replies] Last: If foo() is never to own the auto_ptr (but B is) then foo should take ... (by jsmith)
Using pthreads
 
I found an example code that utilizes pthreads to do matrix multiplication. I wanted to run it to see exactly how it works but I am getting an error that I am n...
[2 replies] Last: You have to perform an explicit cast of the pointer. (by jsmith)
February 2011 Pages: 1... 89101112... 25
  Archived months: [jan2011] [mar2011]

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