General C++ Programming - May 2011 (Page 8)

precision manipulator in C++
 
#include <iostream> #include <iomanip> using namespace std; int main () { double i=1.2345; cout<<setprecision(5)<<i<<endl; cout<<setprecision(15)<...
[no replies]
Custom Frequency RNG
 
This just occurred to me and I thought I should share. Suppose I have a function maybe_one(x) which returns... -> 1 with probability x -> 0 with probability...
[no replies]
expected unqualified-id before ‘+’ token
 
Hi guys, Can anybody help me with this error.. expected unqualified-id before ‘+’ token ............it is in line..... char op1, +, -, *, /, s; my code ...
[2 replies] Last: following the last reply op1 = '+'; //is valid (by closed account zwA4jE8b)
Count the number of times each word occurs in a file
 
Hi I am writing a program that counts the number of times each word occurs in a file. Then it prints a list of words with counts between 800 and 1000, sorted ...
[3 replies] Last: well, it would be different than what you have. the algorithm would... (by closed account zwA4jE8b)
loop for stresses and strains
 
Hi There, This is part of a program I am writing. This part of the code is responsible for computing commulative stresses and strains. The problem here is th...
[7 replies] Last: Do you need to add code to reset these variables when you go to next1... (by Moooce)
Mortgage Payment Using Classes
 
Hey, how's everyone doing today? Well I have this project due and I'm absolutely stuck on this. Basically, this program is designed to use classes to calcula...
[6 replies] Last: The only thing that I can't get to display is the Total Amount Owed to... (by TrevorD)
for the Telephone bill how can i do <filing> like name,address and histotry of last some month billing in this program.
 
Program that will enter the unit reading and showing output to the customer< i.e.Telephone bill>. What program will do? 1.when user enter the particular te...
[1 reply] : Show us what you have implemented that solves 3 to 6 inclusive so that... (by diedrexler)
Random Numbers
 
Hello, I am using Microsoft Visual C++ 2008. I am trying to get random numbers between two numbers. I found this code on a different section of this website tha...
[1 reply] : bool b = rand()%2; Edit sorry, read your post incorrectly. The for... (by closed account GzwXoG1T)
Help with operator overloading
 
I can't figure out how to overload the operator = without getting the error "must be non static member function." I'm using g++. class VectorDouble { publ...
[3 replies] Last: see this for an operator to be defined outside of a class. http://ww... (by writetonsharma)
Callback and static data member
 
Hi all, I have a question regarding a callback that uses threads for a mysql connection. I can't access data member connectionPool in static function worker_...
[5 replies] Last: Thank you for all the help! I've solved it now :o) (by gummy123)
by mdk85
Urgent!! Shopping program
 
void customerDetails::viewCart() { for (int i=0; i<itemDetailsCount; i++) { cout<<"\nName - "<<customerDetailsObject .itemDetailsObject .name<<...
[6 replies] Last: int i = 0; for (int i= 0; i< itemDetailsCount; i++) { ... (by mdk85)
UDF Packet Writing
 
Hello, I am new to this forum. Now I've done some research about file protection. It only comes so far, when you try to protect it. My goal is to make...
[no replies]
Shortest path routing algorithm efficiency ideas
 
Hi, I am designing a routing algorithm for a project I'm working on. I have a graph that has 100 nodes, and each node is connected, on average, to 4 nodes. ...
[6 replies] Last: If you are using STL containers, be sure to measure time on the releas... (by bartoli)
virtual keyword in derived class
 
#include<iostream> using namespace std; class base { public: void fun() { cout<<"base"; } }; class derived : public base { public: ...
[3 replies] Last: Assuming base and derived both have vtables, they could both have dif... (by Disch)
user supplied function
 
is there's a way to make a user supply for function in c++ I know it's a dump question but I was wondering
[6 replies] Last: Then, ModShop's reply (and, consequently, mine) is what you want ;)... (by m4ster r0shi)
by Timbo1
SDL Sprite Sheet Clipping
 
I am trying to create a basic TicTacToe Game in SDL and so far have come up with the code below. Currently I have the board set up with 9 buttons that when you...
[2 replies] Last: Fantastic, thanks so much :) (by Timbo1)
The Most Annoying Linker Error: Unresolved External Symbol
 
As in the title, I'm receiving unresolved external symbol linker errors. I've tried to fix these errors but failed to do so. Here's what I've done so far: ...
[7 replies] Last: It was the one specific library. I solved the errors anyway. It appe... (by closed account zb0S216C)
Type Casting
 
Hello, I have difficulties with type casting. Here I have 2 cases: 1) const OntologyTreeNode** OntologyTreeNode::getChildren() const { const OntologyTreeNo...
[6 replies] Last: thank you, what if for the second case I wanted to return members of... (by john andre)
injecting a dll to a program and running a exported function
 
I am trying to figure out how to inject a dll into any process and run a exported function from the injector. For example: *Inject Dll* *Somehow run the f...
[2 replies] Last: @writeonsharma. I would actually appreciate that quite a bit. I would ... (by avlagrath)
Huffman code in c
 
Hey guys! I am trying to do a huffman program (to compact stuff), but it must be done in C (instead of C++). Can you guys help me?
[3 replies] Last: We can only help, we can't do it for you. (by kbw)
May 2011 Pages: 1... 678910... 32
  Archived months: [apr2011] [jun2011]

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