Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


MzDay

Member Since 04 Dec 2012
Offline Last Active Oct 21 2013 04:25 AM

Topics I've Started

Effective C++ (book)

19 September 2013 - 07:13 AM

I am reading "C++ for the impatient" and I am going to finish this book soon so i figured I should get "Effective C++".

So my question is, is this book updated?

Should i get this book or there are other books that recommended and more updated than this book?

 

thanks in advance.


2D array and pointers

06 August 2013 - 07:57 AM

i have bought a book called "c++ for impatient" (released few month's ago i think) and i came across this:

 

the pointer version is more efficient because it avoids having to evaluate indexes and recalculate the position of elements over and over. It accesses an element directly and than moves to the next position.

with multidimensional arrays, the gain in efficiency is more significant, because calculating the position within such an array is more complex. the pointer version bypasses those calculations.

 

and then they give me a function example of using 2D array with pointers:

void reset_2D_dbl_array(double **p, int nrows, int ncols){
  int n = nrows * ncols;
  while(n-- > 0){
    **p++ = 0.0;
  }
} 

so i have been trying to run this code like so:

#include <iostream>

void reset_2D_dbl_array(double **p, int nrows, int ncols);

int main(){
	double big_matrix[10][10];
	reset_2D_dbl_array(big_matrix,10,10);
	std::cout << big_matrix[0][0];
	std::cin.ignore();
	return 0;
}
void reset_2D_dbl_array(double **p, int nrows, int ncols){
  int n = nrows * ncols;
  while(n-- > 0){
    **p++ = 0.0;
  }
} 

and the code doesn't seem to be working.. i get an error like this:

 

1>main.cpp(7): error C2664: 'reset_2D_dbl_array' : cannot convert parameter 1 from 'double [10][10]' to 'double **'
 

 

what should i do and how can i make the function run like it should?

 

*the function just reset all the cells in the array to 0.0*

 

thanks!


C++ programing book and game developing

14 June 2013 - 04:51 AM

Hey,

I am looking for a book (or more) for c++ that teach me the language from the beginning to the point where i should be an "expert" on it. (does not matter if i need more then one book i will learn it :) )

 

And if you guys could give me a book that would be good on game developing (I will use Opengl if that matter) that would help me move on.

 

i know that basics of c++ but i dont think i know enough, I really want a book that cover's everything that i should know.

 

 

thanks a lot for your help!

 


What programming language should i go with? (C++,C# or java?)

01 May 2013 - 06:36 AM

Title^.

 

I basically have the same knowledge on all of the above and i wanted to know what should i learn and keep going with?

 

my goal is to create games and someday build (maybe) an engine for myself.

 

i think i want to use OpenGL for that and i figured that if all of these languages have opengl library (now all of them the same i know)

i should go with one of them.

 

what is the best choice to go with?

C++ is pretty hard to learn but i can handle it. (pretty fast too from what i understand)

C# is really easy and i can easily learn that language but it's not as quick as C++ and i dont know if the openTK (or what's it called) is the same as opengl openal.. (same function's)

Java same as C# but i dont really like that language i dont know way lol

 

 

thanks! smile.png


EDIT: update on comment 10 :) thanks.


GLUT installation

15 February 2013 - 09:26 AM

im trying to install GLUT but when i run glutmake.bat im ending up with these error's:
Attached File  Untitled.png   38.44KB   59 downloads

 

what should i do? :\

 

by the way, i saw a tutorial that explained how to use GLUT and install it and there was a step that said that i should check

for the dirctory of VC++ for Opengl32.lib file and i couldn't find one.. it could be the problem? (the opengl32.lib is in the VC folder not VC++)

 

thanks!


EDIT:
 

some warning's that i saw after going up:

Attached File  Untitled.png   41.92KB   48 downloads


PARTNERS