General C++ Programming - November 2011 (Page 25)

by GAD
txt file inclusion
 
Suppose I have prepared a question & answer program for which I have created a text file containing questions & answers. Now when I want to pass on this program...
[no replies]
Template Queue
 
I want to make an template extended queue ? How i can make this if any one can give me a solution for this ... ( i don't wan't the standerd queue library i wan...
[no replies]
Modding my code.
 
I have this program that calculates and prints a cell phone bill. I've been stuck at how to approach this task. How would I update the program to prompt the use...
[2 replies] Last: Basically im given an input file which has phone records of a cell pho... (by Ralphus629)
boost::format gives error on overloaded << operator
 
#include <iostream> #include <vector> #include <boost/format.hpp> namespace { struct X { int a; int b; }; std::ostream & operator << (st...
[4 replies] Last: You're including the headers before declaring the operator<<() overloa... (by helios)
working with templates
 
I'm doing some exersize using templates, I try to define class link and class linkedlist, when I try to use it for classes of Book, Books I get error: "use of ...
[2 replies] Last: Thank you!! (by navap12)
by ivansl
array
 
char test can I write this : char test so i can define n later? thanks
[1 reply] : Firstly, many C++ compilers will rightfully object to this, as variabl... (by Moschops)
Program not functioning correctly
 
I am working on a program to control a relay from the Dragon 12-plus board. I have 5v from the board fed through the on board relay to control a RF switch. I se...
[no replies]
by NewDev
Const Correctness
 
Hello All, I am having a problem to digest the const concept of C++ programming language,especially the const pointers and references. I always lose a track...
[2 replies] Last: Thanks a lot Henry !! (by NewDev)
Visual basics run without debugging
 
Hi i have a certain console app and whenever i type in the wrong answer it auto closes but when i run without debugging it asks me to press i button before clos...
[6 replies] Last: Thankyou for your help (by shozza20)
c++ functions
 
Well the following program should be change each function for min / max and average I re-write it up to 10 time and isn't works.... I want a tip since my brain ...
[1 reply] : Please be aware that there are max & min -functions in C++ standa... (by Henri Korpela)
Strange errors when including files
 
Hello, I'm in the process of programming a software renderer. Up to scanline rasterizing now and it's getting fairly complex. Anyway I've been getting some very...
[3 replies] Last: sorry...i didn't mean to offend u,and declaring variables without a ty... (by MasterAsh)
Code DeBug for a State machine (using state pattern)
 
I need some help to bebug some C++ code. I can't see any obvious errors but my compiler reported 36 errors. I think they are all relating to the first error I'm...
[2 replies] Last: One at least partial solution is class forward declaration . Forward ... (by Henri Korpela)
File in and out, (LPTSTR szFilename), HELP!
 
WAVEIN openwave(LPTSTR szFilename) { if (!(w = (WAVEIN) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*w)))) { cout << "error allocating wave han...
[no replies]
Auto close
 
Hi i've been having some problems as as soon as i open this program it automatically closes straight after you get one wrong i was wondering if there was a way ...
[3 replies] Last: So is there anything i can do (by shozza20)
by gizzmo
Is there something else than clock()
 
In my code to get the CPU time I use the clock() function. The problem is that when my code runs for a long time (something like a day) it doesn't give reliable...
[6 replies] Last: I looked into this a little more and saw this is common problem. The ... (by cppabuser)
by phoemi
C++11: capturing variable breaks lambda expression?
 
Have a few situations I wanted to use a lambda expression to initialize a variable. Doing this will allow the lambda body to run once, when it doesn't need to ...
[5 replies] Last: Athar - well, several objects being initialized this way, but many cas... (by phoemi)
help with id
 
Hi, i have the code : #include <iostream> #include <pthread.h> using namespace std; struct arg_struct { int arg1; int arg2; int id; }...
[1 reply] : All four threads have a pointer to the same 'args', so they're all sho... (by jim80y)
Setter/ mutator question
 
I am working on a school project where I am to create 2 instances of an employee object, one where we are to enter the information and one using provided values...
[no replies]
by kcbob
Adding two numbers in string array
 
string array = {'1','2'}; i have an array with numbers but they are characters not integers. and i want to add array + array ; so i can ge...
[5 replies] Last: i can`t understand why you are using a string array to add characters ... (by buffbill)
quadratic equation
 
Write a program that solves quadratic equations. A quadratic equation is an equation of the form ax2 + bx + c =0, where a, b, and c are given coefficients a...
[5 replies] Last: Like "bluecoder" has pointed out already, you should check to see if ... (by Michael37)
November 2011 Pages: 1... 2324252627... 47
  Archived months: [oct2011] [dec2011]

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