klimi
Thanks 🙂
Ask in The future or warn :) no warn now
Nomid Íkorni-Sciurus
Hello guys, I'm trying to understand better templates definitions. What is the difference between template class and template typename?
Roberto
HI guys! If I've the follow error message "mybj.cpp: In function ‘char GetVal(const Card&)’: mybj.cpp:98:1: warning: control reaches end of non-void function [-Wreturn-type] }" It means that the function GetVal doesen't return any type, but the the function actually is defined "char", dosen't it?
Roberto
but why? is not my function wrote correct?
Roberto
https://pastebin.com/FL4L6XhV
Roberto
a message error,i think.
Roberto
oh ok, I got it
Roberto
thanks
Roberto
yep
Roberto
thank you vehlwn
ʞǝʌın
Inqusition!
Francisco
Hello guys, I'm trying to understand better templates definitions. What is the difference between template class and template typename?
There's almost no difference. The only one is when working with template template parameters
Francisco
But whit simple template parameters, it's just a matter of taste or consensus in a business
Roberto
can i poste 5 code's line witout paste bin here?
Roberto
ive a little question
Roberto
about costructor's syntax
Roberto
class Card{ private: CardSuit m_suit; CardRank m_rank; public: Card() : m_suit{CardSuit::CLUB}, m_rank{CardRank::RANK_10} {} Here, I don't understand why the colums after the declaration of costructor and before its body. m_suit and m_rank are member variable and CardRank and CardSuit are enum classes
Roberto
(this code isn't mine)
Roberto
In all example that I've seen the code is like: Costructor(bla, bla) { bla bla bla; }
Roberto
I don't understand that colum
Mihail
it'll initialize m_suit and m_rank to the values in the brackets after them
Mihail
an advantage of using such initializer list as opposed to just setting the variables in the constructor itself, is that you can set member variables even if they are const
मैं भी बेरोजगार 😢
How i learn c language
मैं भी बेरोजगार 😢
Begnir
MᏫᎻᎯᎷᎷᎬᎠ
Beginner*
मैं भी बेरोजगार 😢
मैं भी बेरोजगार 😢
Bhi kya kare kya kya padna padtha hai o level mai c programing kw liye
Dima
Lmao.
Hayk
Ok
* pretending that understood everything *
मैं भी बेरोजगार 😢
Francisco
u cant understand mean
Speak English or you'll get a warn/ban
मैं भी बेरोजगार 😢
Speak English or you'll get a warn/ban
Wait a minut i dont know that only english allowed
Francisco
Wait a minut i dont know that only english allowed
Because you f****** didn't read the rules
मैं भी बेरोजगार 😢
मैं भी बेरोजगार 😢
So tell me how i prepare for c language
Hayk
Wait a minut i dont know that only english allowed
And what did you think? That every message could be written in a different language?
मैं भी बेरोजगार 😢
मैं भी बेरोजगार 😢
Lol
There are some forigner also in this group may be
Mat
No more lang messages, thank you
Roberto
an advantage of using such initializer list as opposed to just setting the variables in the constructor itself, is that you can set member variables even if they are const
If I want initialize the variables in the costructor I sould write: private: CardSuit m_suit; CardRank m_rank; public: Card(suit, rakn){ m_suite = suite; m_rank = rank; } right?
many
Is it common to deal with kernel threads at work?
BinaryByter
there are many ways to do threading
olli
If I want initialize the variables in the costructor I sould write: private: CardSuit m_suit; CardRank m_rank; public: Card(suit, rakn){ m_suite = suite; m_rank = rank; } right?
Yes (apart from the typos). Although you should prefer the initialization (because your once the constructor body is reached all members are initialized already)
Roberto
ok guys.got it
Anonymous
What is that
Hayk
lol
Ariana
why do you need to pay to learn writing code
Ariana
unless its swift
Ariana
makes no sense
Ariana
agreed
Mihail
Yeah that's what I said tho
Francisco
Yeah that's what I said tho
Btw I've just realized that const member variables are not THAT useful. Unless you know your class won't be assigned or something like that, const member variables prevent you from calling some important algorithms (like sort), so I'm now defining the constness by const methods
Mihail
So it sort of makes sense that it'll stop you from doing that
Francisco
So it sort of makes sense that it'll stop you from doing that
Yep, but sometimes some kind of assignment makes sense, and marking variables const prevents you from doing that
Francisco
For example, I made a class that had a constant reference member, and at some point it was convenient to sort some objects from that class. I saw myself moving to pointers to const members and marking methods as const
Francisco
That way I could still have that "constness" and yet use sorting algorithms
klimi
Fortnight
Anonymous
Helli
klimi
klimi
Welcome
uncle
hi every one... what is the diferent beetween INT and CHAR and what is casting?
BinaryByter
the difference is the amount of data they can store and how they are handled
Dima
Lol.
BinaryByter
typically, chars are handled as "character"-values in functions
BinaryByter
ints are handled as "numbers"
BinaryByter
typecasting is just changing the type of a variable to another
BinaryByter
yes
BinaryByter
int a = static_cast <int> (myChar);
uncle
ok. thank you... its giving me the ASCII eqivalence»» thank you
BinaryByter
the » operator is NOT a typecast!
uncle
is there a group like this for javaScript??
Anonymous
can i cast a CHAR to an INT??
Is this a noobs group
Mihail
Is this a noobs group
It's for any level