Learning to work with audio in C++

It really depends on what kind of audio work you want to do, If you want to implement audio for a game, C++ is sure the right language. There are many libraries around, OpenAL is great, free and multiplatform. I also used DirectSound and Fmod with great sucess. Check them out, it all depends on … Read more

term does not evaluate to a function taking 1 arguments

Problem #1: The name of the second argument and the type of the second argument are swapped somehow. It should be: Instead of: Which is what you have. Problem #2: You need to add a couple of parentheses to get the function correctly dereferenced: Eventually, this is what you get: And here is a live example of your program … Read more

Simple string parsing with C++

This is a try using only standard C++. Most of the time I use a combination of std::istringstream and std::getline (which can work to separate words) to get what I want. And if I can I make my config files look like: foo=1,2,3,4 which makes it easy. text file is like this: And you parse … Read more

C++ getInt() function (have a java equivalent attached)

You just try to read an int with cin >> [int variable], and make sure it succeeded. If not, wash, rinse, and repeat: That will work, but will return 12 when given input like 12 a because it will read the 12 and stop at a. If you do not want to just “get as much as you can” and want … Read more

Is string::compare reliable to determine alphabetical order?

According to the docs at cplusplus.com, The member function returns 0 if all the characters in the compared contents compare equal, a negative value if the first character that does not match compares to less in the object than in the comparing string, and a positive value in the opposite case. So it will sort … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)