General C++ Programming - December 2011 (Page 39)

by Taino
rand() help
 
Hi, just need a little guidance in the right direction. What I want to do is generate random statements to congratulate for correct answer. for example. ...
[6 replies] Last: Well, I see Taino is using ctime, and srand.. (by whitenite1)
by barbis
delphi's packed record to visual c++
 
Hello all, does anybody know how treat these packed records in visual c++? On the help file it's stated: // Database info structure TRTDatabaseInfo...
[3 replies] Last: [quote=barbis]Could there be some problems in other parts of the code ... (by coder777)
CLR Thread
 
hi guys.i have problem with thread in clr i have one thread in class Form1 like: while ( true ) { CPM^ _oPM = gcnew CPM(); // the class inherit from S...
[1 reply] : i want to write on Messenger and read from socket always with thread o... (by ahura24)
Constructor not running
 
I'm stumped, here's the code that's dying: Town T(350,200,300,200); class WaterTile { int x,y,sx,sy; public: WaterTile () { sx=...
[2 replies] Last: It is always safe to use std::cout in a constructor of a static obje... (by Cubbi)
std::array of pointers to structs and c++11 for loops
 
Hello all, I created an array of pointers to structs using std::array and I get the beloved segfault... Here is my code std::array<tri*, 128> triangles; t...
[1 reply] : FIXED! Solution: fill the array with NULL pointers before declaring a... (by strongdrink)
C++ tip Calc
 
Hi guys, I made a tip calculator and there is one error;, here is the code. #include <iostream.h> int main() { double bill, tip; int split...
[2 replies] Last: @L B Thanks, yeah that worked with excluding the h and adding namespa... (by NightJay0044)
dynamic allocation
 
I allocate a matrix by dynamic allocation. But I find that some elements from the matrix point to the same memory address! How can I solve this problem, please?...
[2 replies] Last: (gdb) print &gdatat $3 = (int *) 0x100deccac (gdb) print &rdatat $... (by dingyong198608)
compiler says my class is not declared
 
I have classes called janitor, lunch, drink, and school. In the member functions that take classes as parameters, the compiler says that some of the classes are...
[6 replies] Last: It compiled and works fine, thanks for your help. (by RonTheMoron)
ISO c++ forbids declaration of 'iterator' with no type
 
I am trying to create a Map structure, but am having a problem with declaring the iterator for the class. Here is my class declaration: #ifndef MAP_H #def...
[2 replies] Last: Very well done sir. That was what it was looking for. Thanks a lot. (by minimike08)
Output error
 
Ok I'm supposed to be writing a program that simulates dice rolling. The program compiles fine, I just don't understand why the output isn't correct. I get no ...
[1 reply] : You are rolling the dice RollNum + 1 times because of the loop on line... (by Peter87)
what am i doing wrong with linking?
 
the following code gives me the errors error: no matching function for call to ‘amax(int , int)’ error: no matching function for call to ‘amax(double ...
[9 replies] Last: thanks peter. i forget to change the smallest things that have the big... (by skinnayyy)
String anagram checker - How would you have done it
 
Hey folks. So yesterday I was browsing through interview questions regarding programming and one came up that I did. It was, create a function that determines...
[12 replies] Last: I was confused, too - it's because capitals underrun the array. 'H' -... (by jim80y)
December 2011 Pages: 1... 373839
  Archived months: [nov2011] [jan2012]

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