Description:
study group for beginners to learn c
|
|
|
Automatically compute array size
|
| |
How could I simplify the following code:
$ cat test.cxx
static const int array[] = {1, 2, 3, 4};
struct S {
const char *name;
const int (&values)[4]; // why '4' explicit required ?
...
static const S s = {
"foobar",
array
...
int main(int, char *[])
{
return 0;
...
I'd like to avoid doing the counting myself. I'd rather let the preprocessor do it for me (C99 ?). Or maybe a little template<> indirection could help ?... more »
|
|
const reference in POD
|
| |
While trying to build a compiled time dictionary I discovered the following code. It seems to compile without a single warning on gcc. Could someone please tell me if this is legal, and why ?
$ cat demo.cxx
enum TheType {
INT = 0,
FLOAT
...
struct entry {
TheType type;
const int & val;... more »
|
|
How does Inform get around this problem
|
| |
Lets take an example where you were writing an adventure where the player
had to collect three gold coins to complete the adventure.
If the player typed Get coin then would inform know which coin the player
is referring to? Maybe inform just checks to see if there is a gold coin in
the current room.... more »
|
|
class design problem
|
| |
I have been trying to write a very simple class. It represents a 'missile' in a game. It will not compile and i need help with it please.
It is c++ using sfml 2.0 and my compiler is using c++11:
...
...
class missile : public sf::Sprite, sf::Texture
{
// member functions - perform operations on data members... more »
|
|
Using C++ with sfml library problem
|
| |
Hi,
I have tried asking this question in the sfml forum - but so far have not
had any clear answers. I am hoping that you will be able to help me. The
problem might be with my interpretation of the documentation.
I am trying to implement a version of space invaders game in c++ using the
sfml library. Once i have working code, the plan is to redesign it into a... more »
|
|
Low level I/O in C
|
| |
Is it possible to do low level memory mapped or port IO in C just like we do using IN and OUT in assembly??
|
|
Solution Manuals & Test Banks
|
| |
Hi dear students;
We are SolutionManualGroup.We established SolutionManualGroup in 2004.
SolutionManualGroup is the leading provider of Solution Manuals and Test Banks help for college and graduate degree students.We have solution manuals and test banks for a competitive price. We also have
other manuals more than 3000..We have a lot of solutions manual and test banks in low... more »
|
|
what type of c++ container is appropriate?
|
| |
I am in a problem situation.
I have this :
std::vector<sf::Sprite> alien_fleet(55, alien);
This vector will hold a collection of 55 Sprites (for a game). There is no problem in it compiling. The problem is that each element of the vector - each 'alien sprite' MUST be associated with a cartesian... more »
|
|
How to Copy filenames in to array?
|
| |
Hi all
I read filenames present in folder with:
DIR *dir;
struct dirent *ent;
if ((dir = opendir ("C:\\")) != NULL) {
while ((ent = readdir (dir)) != NULL) {
printf ("%s\n", ent->d_name);
}
closedir (dir);
But how do copy filenames in char array?
char *namefilesinfolder[100];... more »
|
|
|