Anonymous
Not works
it must
Anonymous
Deni
it must
Visual studio gives errors i've used It before
Anonymous
show the error
Anonymous
very good group
Anonymous
good job admins
Anonymous
👍🏽
Deni
The function f don't accepts 0 args
Anonymous
The function f don't accepts 0 args
use std::forward<T>(args)... to unpack the params
Deni
I Need to use the function with all'args for a wrapper of winapi threads
Deni
Because not exists on Windows std::thread
Anonymous
Because not exists on Windows std::thread
Lol waaaat😂 std::thread exists everywhere in c++11 It is a standard wrapper on threads You definitely need to use it
Deni
Try
Deni
To use
Anonymous
To use
What? I can use std::thread on Windows
Anonymous
And you can
Anonymous
I don't understand what is the problem
Deni
On mingw?
Anonymous
On mingw?
Both MinGW and VC++
Deni
On mingw not works i've tryied many times
Anonymous
On mingw not works i've tryied many times
That means you didn't used it properly
Deni
Posix threads not works i've tryied with mingw installer
Anonymous
What is virtual base class?
Yogesh
Can u send me this file ?
klimi
Can u send me this file ?
He deleted his profile
Yogesh
klimi
Its from 11 February
Yogesh
Do you have any project ideas ?
Lucifer
Hye
Anonymous
hello lucifer
Lucifer
Guys
Anonymous
are you from hell
Lucifer
are you from hell
😅😅😅
Lucifer
Please decrease time of slow mode!!
Anonymous
why
Because He Wants To Write One Word Per Message
Anonymous
klimi
??
i am not decreasing it
Lucifer
Because He Wants To Write One Word Per Message
😅😅😅Not like this bruuh
Anonymous
😅😅😅Not like this bruuh
I'm not a bro, I'm the sir
Anonymous
I'm not a bro, I'm the sir
is that you in your profile pic you're very beautiful
Anonymous
sir
Anonymous
Dadaskis
Sas
Anonymous
Sas
i agree
Artöm
What is virtual base class?
https://en.cppreference.com/w/cpp/language/derived_class
Mateo
Hi! this is a question not directly related to cpp but to the observer programming pattern. I have a Player that wants to build a Tower in the Board. What I would've done is: inside the okButton event, subtract money from player, and add a tower to the board, meaning this event knows the interfaces of player and board so it has some level of coupling. If I use the observer pattern, I create an observable buildTower, to which Board and Player were subscribed to in some initialization procedure. Player and Board each receive the notification, and the logic for discounting player resources is in the player, and for placing the tower in the board is in the board. Is this a good use of the observer pattern? If before I want to check if the player has enough resources to build a tower how should I do that using the observer pattern?
Al
hello i try to initilize an array of strings *char[3] = {"One" , "Two" , "Four"}; ... if i try to printf ("%s\n",char[0]); i havfe seg fault ... not sure why
Al
char *num [3] = {"One" , "Two" , "Four"}; thats the arrya sorry
Al
when i try to printf ("%s",num[0]);
Al
i receive seg fault..
Al
im not sure why
Artöm
const
olli
when i try to printf ("%s",num[0]);
is this the only time you access the array? #include <stdio.h> int main() { char *num [3] = {"One" , "Two" , "Four"}; printf("%s\n", num[0]); } Does not segfault
Anonymous
Can we use array elements for condition checking in loops EG: for(AR[0];AR[I]!='/0';AR[0]++)
Harmanjit
I am a beginner so i might be wrong Shobin Try if else condition n check ur array comparison, u will knw that we can use it or not
Harmanjit
I think it will work. M not sure . Do it practically
Sid Sun
is this the only time you access the array? #include <stdio.h> int main() { char *num [3] = {"One" , "Two" , "Four"}; printf("%s\n", num[0]); } Does not segfault
num is an array of pointers to characters, you will need to derefernce it when you access the value and you cannot store strings over there, a char is one character I might be wrong
Sid Sun
I probably am.. 🤦‍♂
olli
num is an array of pointers to characters, you will need to derefernce it when you access the value and you cannot store strings over there, a char is one character I might be wrong
the code works as expected. Just wanted to point out that the given information by @Nutellink are not sufficient to reproduce the issue.
olli
Hypothetically, if I did want an array of pointers to char.. how would I define them?
The general solution would be char ** array, if you know the size you can also use char * array[SIZE]
olli
The second one allocates the space, for the first one you would need to allocate the space manually (e.g malloc )
Sid Sun
The general solution would be char ** array, if you know the size you can also use char * array[SIZE]
Well, you used the second one to store array of strings (char array), I don't understand how it is equivalent of pointers to an array of pointers to single chars
olli
Well, you used the second one to store array of strings (char array), I don't understand how it is equivalent of pointers to an array of pointers to single chars
char * array[3] is not a char array, it's an array of pointers to char. Since an array can decay to a pointer you can assign it to a pointer to pointer to char (char ** ) e.g. const char * ar1[3] = { "one", "two", "three" }; const char ** ar2 = ar1; does this answer your question?
olli
Sid Sun
a single pointer to char? Like this char *charPointer;
I mean you declared: const char * ar1[3] = { "one", "two", "three" }; Since it is an array of constant pointers to chars, how come we can store "one" in the location pointed by the first pointer or "two" in the next one and so on..