General C++ Programming - October 2012 (Page 47)

BST/Pointer in function call problem
 
#include<iostream> using namespace std; class btree { public: struct node { int data; ...
[1 reply] : It's your insert function, see my comments void btree::insert(node *&... (by naraku9333)
by Brody
Pthreads and top command
 
Hi All, -- Simple question/Sanity check -- When running a multithreaded program, with Pthreads, and observing it with the linux top command, I should see %C...
[no replies]
HELP !!
 
hi friends, i wrote a c++ program, actually it's a game; Robots game ... but i've recieved this error "Windows has triggered a breakpoint in bla bla.." can some...
[3 replies] Last: delete r_location_i; delete r_location_j; You only use delete when d... (by pogrady)
Difference between these two sets of codes
 
1. btree::node* btree::find(node *temp,int item) { if(temp==NULL) return temp; else if(item>temp->data) ...
[1 reply] : The temp that is returned by the first one is not NULL when the recu... (by clanmjc)
pass a pointer as call by reference
 
How to pass a pointer as call by reference?
[5 replies] Last: What exactly is the problem and where is it? What do you mean by non... (by clanmjc)
SDL Application will not open
 
Every time I try to run my application, it will not open. It complies just fine, but it will not run. Can someone help me figure out where I am going wrong here...
[10 replies] Last: Makes sense. Thank you. :). (by Nathaniel Sheller)
argument of type void* in pthread_create(...)
 
Why is it necessary to pass argument of type (void*) while creating a thread using pthread_create(...)?
[1 reply] : Clearly you'll need to pass some information to the thread function as... (by kbw)
Arrays
 
I need to identify the maximum number and also need to have the program identify the row and column that it is in. Here is what I have so far but #i...
[1 reply] : Name Values is not declared. So the compiler shall issue an error for ... (by vlad from moscow)
? with Do While
 
In my do...while loop I have this below. when I do that and the loop repeats, it ignores one of my variables. I ask them to enter their name and it just puts...
[3 replies] Last: try just: cin>>your_name , instead of getline operation. (by learntogether)
cin.fail() does not work properly
 
Hi everybody, here is my simple code. I ask the user for a non-negative number, if it's not a number then I print on screen something like "not a number". ...
[1 reply] : It is working just fine. It just doesn't require any space to be betwe... (by Duthomhas)
by amir22
The Monthly payment calculation
 
I am not sure how to do this because I am very new to C++ The Monthly payment on a loan may be calculated by following formula: Payment = Rate * (1+rate)^n/((1...
[1 reply] : Get the user to input the information you need. Store it in variables... (by TimBob12)
by TTT
virtual function
 
Hi, can anyone explain the result of this program??? how the private function called #include<iostream> using namespace std; class Base{ public: v...
[6 replies] Last: I was speaking to the OP, clarifying what you had said... because you ... (by clanmjc)
by jbby78
I need help with the beginer c++ code!
 
So in intro to c++ class we are writing codes using functions and importing text files to read it and outputting them in a diffrent text file. I wrote the funct...
[1 reply] : Instead of this inFile >> coeff; double a; I would suggest:... (by Chervil)
Information in map lost after function return
 
Hi all, I have something going on that I don't quite understand. I have the following code: void CPlexAdaptor::addVar(Var *v) { pair<map<Var *, IloNumVar>:...
[7 replies] Last: The Var pointer that the addVar method receives is a pointer to an el... (by clanmjc)
Reading into the array number using pointers
 
i had try. But if it does not have en error i would not be here. how to write a program that random number entering into the array number using pointers? ...
[1 reply] : int a ; int *p = a; *( p + std::rand() % 10 ) = rand(); ... (by vlad from moscow)
Need help creating pointer in a class that points to a separate variable.
 
I'm trying to find a way to create a pointer inside a class that points to an image variable that has already been created. That way instead of always passing t...
[3 replies] Last: Ah ok thanks. I did not know I could use new from outside the class. T... (by Tyler Hummel)
Controlling the computer with C++
 
Hi everyone. I want to write a code that I can turn off the computer writing to the screen "close". I wrote a code then I can turn my computer off with C++ but ...
[6 replies] Last: Thanks for your help but your code still does not work. I Think there ... (by Xphysics)
Calculating sin(x) with the power series
 
Write a program that calculates the value of sin(x) from the power series x - (x^3/3!) + (x^5/5!) - (x^7/7!) + ..... The user should be prompted for both the va...
[no replies]
Help with Array
 
I'm working on a Genetic Algorithm project and need to write a code to do the crossover operation. I need to select a few array and swap the array at a given po...
[no replies]
by leoo
Random header, checksum?
 
I had a program here that I wanted to analyze. The program has a random header all the time, but the process name has the same name all the time. Now my firs...
[3 replies] Last: OOoooohhh... right right. Whoopsie. (by Disch)
October 2012 Pages: 1... 454647484950
  Archived months: [sep2012] [nov2012]

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