@ddanbe, Awe man idk I havent tried to soldier them yet, just recently got an audrino board, hopefully it goes smooth. Which type of LEDs do you have? There are these awesome RGB ones but theyre so expensive

@ddanbe: Haha I was going to guess for xmas. Nice sounds pretty cool, definitely more rewarding to build your own haha. I recently started a LED project as well, trying to make one of those led cubes. They look so cool.

@imthewee: Haha I'm doing good, the app is my side project. At my job I'm doing pretty important stuff, can't really talk about right now. As for my side-project, I'll have a prototype of the app soon, its web based. Tested it on iphone/android and desktop and looks good so far. I'll definitely let you guys know when alpha is ready so you guys can check it out and maybe test it.

How's firstPerson doing? You seem to have settled into your new job... Do you have a linky to your app or is it a non disclosure company thing?

C++ doesn't have an interface to allow you to create any GUI code, but you can use external libraries to draw the GUI stuff and control it with C++.

For example here is a gui application in C++ using the QT library:

#include <qapplication.h>
#include <qpushbutton.h>

int main( int argc, char **argv )
{
    QApplication a( argc, argv ); //create a window object

    //create a button object with the text 'hello world'        
    QPushButton hello( "Hello world!", 0 ); 
    //set the size of the button
    hello.resize( 100, 30 );
    //add it to the window
    a.setMainWidget( &hello );
    //enable our button to be shown, by default it is hidden      
    hello.show();
    //show our whole window
    return a.exec();
}

There are many tutorials out there for this, I just stole the above from here: http://web.njit.edu/all_topics/Prog_Lang_Docs/html/qt/tutorial1-01.html ,

But judging from your post, I do not suspect that you have grasped most of the concepts in C++, so I would suggest to start doing more projects and not worry about gui stuff until you have a solid grasp of C++. How much of its concepts do you know, for example arrays/if-else/classes/structs/templates?

Ancient Dragon commented: good advice +14

@ddanbe: Building from scratch? Are you planning on making anything with those LEDs?

I use that mapeditor, but usually export it to json. Actually exporting it to json is what you need. It has a "data" attribute which is an array of numbers like you have above, and each number represents a tile.

@iamthewee, whats your fav movie? any suggestion?

We all go through them, some worse than other, the key is to realize that you are in one and then try to get away from it by doing various positive fun things. But depression isn't all bad, its actually healthy in small dosage according to me lol.

Grimjack- dont let you depression get you down i just dealt with my depression about two months ago.

No way hot glass workbench, thats pretty cool. Do you have some pictures of what youve made so far or what you plan to make. What are you doing in Montana?

Me? Oh nothing much, just bored at work. Working on a new web-app project on my free time. Planned to be in the appstore. Going to hit #1, just watch. How about you?

I'm using Phaser engine for a 2d web platformer game, its not too bad, give it a shot

Can you just use notepad search/replace to format the csv file? or is this just for practice

Else statement is connected to the if statement. Once the if statement is executed, else statement is not executed even if the while statement inside the if returns false or true or never returns.

Try this cout << " just inserted new element. " << (ret.second==true) << endl; or better yet just cout << " just inserted new element. " << ret.second << endl;

Usually you overload the operator[] for constant-ness. Are those operators defined in some class?

Consider these statement

T* a = getA();    
const T*b = getB();

if(a[0] == 1) doA();
if(b[0] == 1) doB();

Without the const T& operator[](int)const version, the b[0] == 1 would not compile because b is declared as a constant, therefore could only call member functions that are constant.

Royal blue, bought my first car last summer. 2007 tiburon GT. Sexy little self. Got it for a bargin too. 21K miles for 8G.

Interesting history post. Thanks for the information. Off topic kinda but I wish more people would just stop what they are doing for 5 minutes and just observe. Observe the society, observe the body languages, observe the human interaction, observe nature and its wonderful mathmatical creation, observe people and their talents,and just appreciate life and its wonderful glory. Its beautiful.

Be nice. So you want to alternate rotation. In that case you need a little bit more logic like so:

if( isSpaceKeyPressed()){
  int currentRotation = line.getRotation();
  if(currentRotation == 90){ //is horizontal( flat line )
    line.setRotation(0); //make it straight line
  }else{
    line.setRotation(90); //make it flat line
  }
}

Maybe this startup hint would help you

#include <iostream>
using namespace std;

void getMonthsData(int data[], const int SIZE){
  //print message
  //for i = 0 to size 
    //ask for data[i]

}
void getYearData(int data[], const int SIZE){
 //print message
 //for i = 0 to size
   //ask for data[i]
}

void getAverate(int data[],const int size){
 //your get_average logic here
}

int main(){
 int data[12] = {0}; //zero initialize everything
 int MAX_SIZE = 12;

 int choice = -1;
 cin >> choice; //get user input

 switch(choice){
  case 1: MAX_SIZE = 12; getMonthsData(choice,MAX_SIZE); break;
  case 2: MAX_SIZE = 10; getYearData(choice,MAX_SIZE); break;
 }
 cout << "Average= " << getAverage(choice,MAX_SIZE) << endl;
 return 0;
}

Member functions are not the same as regular functions. There is a little more work, here is an example:

class SampleClass
{
public:
    int plusfunc (int a, int b);
};

int SampleClass :: plusfunc (int a, int b)
{
    return a + b;
}

typedef int (SampleClass::*functor3) (int a, int b);

int main(){
 SampleClass sc;
 functor3 f[1] = {&SampleClass::plusfunc};
//note you need an object to call the function that f points to
 cout << (sc.*f[0])(1,1) << endl;
 return 0;
}

http://codepad.org/w6WexeJy

@nullptr, nvmd didn't realize the 'last' word in 'lastLargestIndex'

No need for copies or iterating over multiple condition. There can be perfect forwarding,references or pointers, if needed. And you can combine multiple functors into one if you only want to run through the list once. I just think this would be the better option of the two and a lot less code

If you are going to go the iterator route, then you might as well make it stl compatiable and inherit from `std::iterator'.

Another option is to simply have a filter function like so:

template<typename Container, typename FilterCondition>
std::vector<typename Container::value_type> filter(const Container& cont, const FilterCondition& cond){
 std::vector<typename Container::value_type> filteredList;
 for(int i = 0; i < cont.size(); ++i){
    if(cond( cont[i] )) filteredList.push_back( cont[i] );
 }
 return filteredList;
}

bool isDead(const Actor& actor){ return actor.isDead(); }
bool isChildActor(const Actor& actor){ return actor.age() < 18;}
bool isGirlActor(const Actor& actor){ return actor.type == Actor::GIRL_ACTOR: }
int main(){
  ActorList actors = getActors();
  ActorList childActors = filter( actors , isChildActor );
  ActorList childActorWhoAreGirls = filter( childActors, isGirlActor );
  //..and so on

Warning, syntax is probably wrong somewhere, but the general advice should help.

Is this operation being performed on Actors only? Do you have a list of Actors available to apply the filtering?

Your code seems fine, it might be how you setup the environment. How'd you set up your environment? I haven't used netbeans in years. But typically in any ide, there is an option to create a C++ project. Did you try to run a simple hello-world program and see if that works:

#include <iostream>
using namespace std;
int main(){
  cout << "TEST" << endl;
  return 0;
}

Is that function a virtual function, can you change its sigs? Why not return a std::pair<bool,Handle> ?

bool operator==(const Birthday &x, const Birthday &y) 
{
  if ((x->getMonth() == y->getMonth()) && (x->getDay() == y->getDay()))//i am getting errors here
    return true;
  else
    return false;
}

Bad syntax above, try this:

bool operator==(const Birthday &x, const Birthday &y) {
  return (x.getMonth() == y.getMonth()) && (x.getDay() == y.getDay());    
}

ok cool, don't forget to delete what you new-ed. What is your question?

Awesome, thanks dani