Do you mean i have to declare X Y in a different way like the above ?
struct data {
int size;
int X<>;
int Y<>;
float r;
};
Type: Posts; User: ch4
Do you mean i have to declare X Y in a different way like the above ?
struct data {
int size;
int X<>;
int Y<>;
float r;
};
Hello,
I'm writing an RPC C program in LInux and i want to pass dynamically allocated arrays, but only the first element of the arrays is reachable at the server side.
struct data {
int...
ok, i see.
Thanks
But function is already friend.
Hello fellows,
I want to access protected member of inner class from within friend function of the outer class, without adding getter to inner class. Is that possible ? Any advice ?
...
It may be my confusion for years. I believed the exact opposite. That is, i have to use underscore in front of, so as to avoid collision with reserved definitions. Thanks for the correct reminding.
...
But i have to admit that the compilation errors have lead me to another direction.
I have just found the solution.
The ostream couldn't find the way to print string. I've just included <string> and it does compile finally.
I've removed const from player and then the error...
Thanks for the advices lasrlight.
This code is not for bussiness. I was just helping someone and, while i was so sure that it does compile, i was surprised.
The above is the minimal which is not...
Check attachements.
2 headers (one with the problematic code)
1 cpp with main.
This minimal edition compiles and run on g++ (linux).
I've tried on two different machines with VS 2015...
Yes, i do have code to test this function.
Yes, i do have main.
No i don't instantiate object of Player. Instead, i do instantiate subclasses of Player (such as GreedyPlayer) which are not abstract...
Hello fellows.
I have tested the above code to g++ and it's ok. It does compile.
class Player {
private:
string name;
public:
Player(const string &n)
{
Sorting col_data by id would be cool.
Otherwise, searching for indexes in a meshed up col_data will lead to two nested loops.
//Edit
Thinking again, would you mind giving us more info about...
That's why we don't have to care about the value of NULL. Just use it as "NULL" Simple as pie.
In reality i don't know if NULL is being used for other purposes except pointers. Not sure.
NULL - C++ Reference
http://tigcc.ticalc.org/doc/alloc.html#NULL
I don't know why you're back still wondering which programming language to choose. It seems that your thoughts drop you into endless loops such as while(1).
So write a break; statement and pick C.
Some advices without testing your code.
1. Do not hijack the code with comments
2. Use curly brackets to if-else statements. Only identation doesn't work. if/else without curly brackets nests a...
1. Here's the deal. As you propably know all pointers pointing somewhere in memory that's why are holding mysterious numbers. If you need a pointer to point to nowhere or you want to initialize it or...
verifica it's a character, not an array of characters.
Try char verifica[200]; and check again arguments of strcmp.
The very fisrt step before add a node is to initialize the head/last pointers to NULL propably into main.
Decide the way new items should be inserted to list. (Let's say at the end)
In the...
Fix add function.
Get a papper, draw (just some cubes + pseudoalgorithm) the list according to your add function and see what's going on.
Then draw on papper the appropriate way.
1. You should name your variables in more explainable way. (b,d = ???)
2. one is pointer to pointer. one[0] is pointing to pointer. If one[0] isn't null (0) then has as value a memory address that's...
So, post your new version.
Go to line 20 and remove semicolon.
Placing semicolon right after while(),means that loop and do nothing.
I haven't read the rest but you may have issues when reading chars instead of ints. (line...
scanf is not working this way. Read more here.
scanf differs from printf. Provide as argument a pointer to your variable (in reality address space). In you case &num1.
scanf("%d", &num1);
If...