General C++ Programming - July 2011 (Page 26)

Matrix Multiplication
 
Hi there! I was wondering if you could please look this over real quickly and see if there's a small error that I am missing. I am multiplying an 8x13 matrix...
[no replies]
template default
 
Hello, i wanna know if is possible declare a class(A for ex) and use it with template default on your own. template <class T, class U = A> class A { .....
[10 replies] Last: So, not is possible I do something like this: template<typename T, ... (by scaloni)
by namcs
Optimize this code
 
Hi all, I need to optimize this chunk of code: unsigned char* image = ....; for (int i=0; i<height; i++) { for (int j=0; j<width; j++) { ...
[7 replies] Last: Hi Athar, thanks for the suggestion. I will try on that. Hi Kev82, bes... (by namcs)
What header I need in a mexfunction so nextafter is recognized?
 
I am a little confuse. I am doing a mexfunction I had some rounding problem with the ceil function in line 46 of the following code. #include <math.h> #includ...
[10 replies] Last: this may be due to lots of pointers you have taken. avoid pointers whe... (by writetonsharma)
iostream changes a pointer
 
I'm writing a chess program, and once I use any cout or cin or cerr, a pointer in board changes, and becomes a null pointer. int main() { //ini...
[12 replies] Last: for your kind or problem, learn to use new/delete. Otherwise it will b... (by writetonsharma)
Recommend me some books. :)
 
Hey guys, I need some book suggestions. I would prefer these books, or at least their contents, to be up-to-date. So here is specifically what I'm looking for. ...
[6 replies] Last: Thank you guys so much! I'll be sure to check out all those books. :) (by Jdc1197)
execution time, IDE (debug) directory vs exe
 
Im without a C++ IDE right now. This should be a simple question though. If I compile a program and run it in the VS IDE, it generally compiles to and exe...
[5 replies] Last: Debugging information doesn't actually slow the program down, but the ... (by Athar)
If statements?
 
Hello Brilliant C++'ers! I am attempting to make life easier on myself, but pulling my hair out in the effort. Here is what I would like to do... I would ...
[1 reply] : so are you wanting the user to input something like "C:\directory\file... (by closed account zwA4jE8b)
by Brad1
Need Help Please!
 
How would i revise this program to randomly generate an addition question with two integers less than 100. I am new to this and would appreciate any help! Than...
[3 replies] Last: You shouldn't have the "(" character there. Either enclose it in doubl... (by Computergeek01)
by GPP
General math calculations
 
int calc_x = floor(origin.x/32); int calc_y = floor(origin.y/32); int test_square = floor(calc_y*ROOM_WIDTH)+calc_x; if origin.x and origin.y are both se...
[12 replies] Last: calc_x = floor(origin.x/32) calc_x = floor((100)/32) calc_x = floor(3.... (by GPP)
Heap Corruption
 
As always, I'm messing around with memory. Now, I've run into a heap corruption. To replicate the problem, you can compile this: #include <iostream> ch...
[8 replies] Last: I never realized that it was such a big problem. Given the explanation... (by closed account zb0S216C)
How to structure 3D collision detection?
 
So far, I've been giving each of my in-game objects a step() function, and calling that function each step. In each object's step() function lies the game logic...
[6 replies] Last: If I understand the thoughts here. The step function deals with mov... (by Azagaros)
by GPP
how to test a functions true
 
if (check_area_free(origin.x,origin.y+1) == true) { vspeed+=.1; } Im not to sure if Im writing this properly or not. I have a fun...
[3 replies] Last: Thanks Guys, and I had a feeling there was a way to shorten it. (by GPP)
Comparing an argv element to a string?
 
I'm having problem with comparing the two in an if statement. I am doing this: if(argv =="-e"){cerr << 'E';} but the program skips over it as if argv doe...
[1 reply] : both argv and "-e" are char* (pointer to character). Pointers are bas... (by hamsterman)
by sebgar
visual studio to code::blocks
 
Could someone please translate the instructions below (which are for Visual Studio) into Code::blocks?? i tried to figure it out myself but these 2 IDE are quit...
[2 replies] Last: i don't know much about libraries 9this is my first time using them), ... (by sebgar)
Crypto++ Linking Issues
 
I am trying to implement one of the hash functions in Crypto++, and when I compile the following code: #include <cryptopp/sha.h> using namespace std; int main...
[4 replies] Last: and use -I for include and -L for library paths too. (by writetonsharma)
map and set erase
 
Your reference library appears to be out of date, at least for map and set These no longer return void, but return an iterator to the next item. I believe t...
[1 reply] : did you intend to reply to someone? or this is a question? (by writetonsharma)
by ramako
warning: reference to local variable ‘tmp’ returned
 
Title says all. It happens when overloading the operator- . const ColeccionCoches &ColeccionCoches::operator -(const char *fichero) const { ColeccionCo...
[5 replies] Last: If you want to return a tmp object then you must return by value, not ... (by Galik)
by eidge
C++ Without Fear, where to go now?
 
I'm finishing C++ Without Fear. I've went through many different posts and articles to try and find the next logical step from here. The problem is I can'...
[10 replies] Last: Thanks for the help. Don't be to happy though, because as soon as I fi... (by eidge)
by Fede85
Finding roots on an equation
 
Hello, this is the first time that I program with C++. I want create a program to able to compute the root of an equation with unknown degree. I want to use "bo...
[4 replies] Last: I don't know the bisect function, but I would assume it goes something... (by kev82)
July 2011 Pages: 1... 2425262728... 30
  Archived months: [jun2011] [aug2011]

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