Beginners - March 2011 (Page 11)

formula!
 
hi, the formula = 1/3PI x Radius^2 x Height in C++ program I wrote it like this = (((1/3)*pi)*(pow(r,2))*h) pi,r,and h declared as float is...
[5 replies] Last: thanks :) (by Thuraya)
finding a new route
 
I am trying to code a program that can find the shortest possible route for a trip. It's like i want to visit spot A, B, C, D, E, F, G and those are all scr...
[2 replies] Last: Google "tsp genetic algorithms" (by m4ster r0shi)
by Sina
Dereferencing and referencing at the same time?
 
I am reading a code and I encountered the following line: Memory *&memory; . Seems kind of strange to me? what is the difference between that and this one...
[3 replies] Last: thanks guys (by Sina)
Graphics
 
Can anyone please tell me how to incorporate graphics into a windows window?
[4 replies] Last: http://www.sfml-dev.org/index.php (by oldnewbie)
Classes sleeping?
 
Hi, in my game engine i have: else { // Make sure the game engine isn't sleeping if (!GameEngine::GetEngine()->GetSleep()) ...
[5 replies] Last: If its meant "pausing",it may be to pause "updating display","doing ca... (by oldnewbie)
Math formula
 
I'm not sure this is in the correct forum , but if not, could an admin/mod please move it. Thanks. Ok, so I'm going to code information of a circle, given th...
[2 replies] Last: Thanks for the reply. I'm going to code a function for each entry ( 4... (by Lynx876)
Using sscanf to read text file
 
I am writing a C program and I am saving data in a text file and then I am trying to retrieve that data. The Text file looks like this: Name Date ...
[no replies]
by myrtle
structure inventory program
 
I am writing a data structure program to store inventory data in a file, then I need to read and display that information. The problem is, is I am getting an er...
[11 replies] Last: line 38: you already declared int menu() inside of struct InventoryIt... (by ModShop)
by Sina
Pointer to class??? (1,2)
 
Hi, can any body explain to me what the function of the line 'class class_name_2 * class_pointer ;' is in the following code? Could you please introduce me to...
[27 replies] Last: Thanks guys (by Sina)
Two Dim Array Segfaulting
 
I am trying to initialise and print a 10x10 array to the console. This code works, but I get a segfault at the end of it and I don't know why: int main()...
[5 replies] Last: Solved! Thanks all for the speedy response. (by JLucien)
by cc89
Simple entity class
 
What's the proper way of creating a simple entity class in C++ whose only purpose is to store publicly accessible variables? In Java, for example, I'd do someth...
[5 replies] Last: Use std::vector instead of arrays: http://www.cplusplus.com/reference/... (by hanst99)
Variables
 
I need a variable type that can store spaces, numbers and letters. any help would be good.
[6 replies] Last: Thank you, it worked!!!!!!! (by closed account SEbXoG1T)
best way to pass value through constructors? (1,2)
 
Hi - Assume you define a class to contain another class, which in turn contains *another* class. During construction of the top-level class (if possible) you...
[22 replies] Last: Oh, OK...of course. I just finished tracking down a few bugs in my con... (by mzimmers)
argument error in copy constructor
 
I'm trying to create a constructor like this: Cell::Cell(const Cell &dsfc) { Reg::clone(a, dsfc.a); } Question 1: if I leave out the const, the c...
[9 replies] Last: Ahhh...I got you. Excellent thinking. Thanks; I'm still trying to wrap... (by mzimmers)
Questions
 
I am trying to code a program that can find the shortest possible route for a trip. It's like i want to visit spot A, B, C, D, E, F, G and those are all scr...
[2 replies] Last: And what do you mean with "the compiler will stop running"? (by hanst99)
istringstream
 
Can anyone please tell me why I cannot reassign a value into values ? int _tmain(int argc, _TCHAR* argv ) { rectangle r; std::istringstream values; ...
[2 replies] Last: Yeah, that works! Thanks for the reply, much appreciated. (by Lynx876)
Help With Battleship Programming Assignment
 
I need help writing code for my latest C++ assignment. I have to be able to place battleships randomly on a 10x10 grid. Two of the ships need to be horizontal (...
[5 replies] Last: Ok, so I went to my professor and got some help. Now my program is a b... (by L0neWolf001)
file handling with fstream
 
with fstream why do seekg and seekp work in unison..fr instance if i bring seekp to the beginning tellg also returns 0 etc...why cant i point to a place...
[12 replies] Last: I'd always rather write a function that dumps some structure into a fi... (by filipe)
Infile Calculator?
 
I'm trying to read in a set of data from an infile and have my calculator read the numbers and output sums, running into a bit of trouble though. #include <i...
[3 replies] Last: Ok, so first things first this isn't Java so functions do not have to ... (by Computergeek01)
by caneta
Passing a parameter to a boost::static_visitor
 
Hi. I have this situation: typedef variant<Flag<int>, Flag<float>, Flag<double>, Flag<string> > var_t; class addFlagParamVisitor : public boost::static_v...
[3 replies] Last: Of course there is! Here my solution: template <typename T> class g... (by caneta)
March 2011 Pages: 1... 910111213... 52
  Archived months: [feb2011] [apr2011]

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