MᏫᎻᎯᎷᎷᎬᎠ
Here is a sample code
don't judge cuz it's not complete
template<class T>
T test()
{
if(is_same<T, string>::value)
{
string s = "lunatic";
return s;
}
.
.
.
Error:
Cannot convert from 'std::string' to 'T'
Why the ....???
BinaryByter
use is_same_v<T, string>
BinaryByter
first of all
BinaryByter
can you give us the entire message?
BinaryByter
the return type of your function is a string
BinaryByter
and your T isn't (always) a string
BinaryByter
return a T
MᏫᎻᎯᎷᎷᎬᎠ
i did this
return T("lunatic")
BinaryByter
won't work if T is an int
MᏫᎻᎯᎷᎷᎬᎠ
And it WORKED
MᏫᎻᎯᎷᎷᎬᎠ
Yyyyy
BinaryByter
if you want to use SFINAE, you should use an enable_if
MᏫᎻᎯᎷᎷᎬᎠ
BinaryByter
look it up
BinaryByter
:)
MᏫᎻᎯᎷᎷᎬᎠ
Ok
Anonymous
I have no idea how I m start coding any one help me pls🙏
Dima
Mihail
This isn't a channel it's a group
Mihail
And just start by doing some coding like Hello World and trying to understand what it does
Anonymous
Mihail u nailed it😂
Palinuro
@sombochea happy to see you here :)
Sambo
@palinuro Me too.
Anonymous
Thanks
Jagadesh
Okiee
Mr.Robot
Hi
José Manuel
Hi! 🙂
Kotak
i am havinig trouble with switch statement with charceter in which the control is directly going to default statement i dont know can i share the code and output?
Pratham
Send a pic of your code here
Kotak
i am sending c file
Kotak
Anonymous
Try with "case !1:" and see if it executes first case
Kotak
ok
Anonymous
Anonymous
Nvm
Anonymous
Lol
Kotak
no its still going in default
Anonymous
Kotak
its not asking for char value its directly going to default😅😅
Anonymous
Kotak
though i have used scanf i dont know why its directly going to default
Anonymous
Anonymous
printf("%d\r\n", scanf("%d",&i))
Kotak
as soon as i am entering the value for first switch stament is executes its and then paases the control to second switch wihtout asking for input from user
Anonymous
That's how switches work
Anonymous
Well you have breaks so maybe not
Kotak
i am sharing the output as well as input in a pic
Anonymous
Ok
Kotak
Anonymous
Guys
Anonymous
If I wrap my cpp code in python
Anonymous
Will the program be faster
Anonymous
Or it will be slower when compared to the scenerio when i have written code explicitly in python
Anonymous
Hii svp moi étudiante j'ai pas compris l classe en c++
Anonymous
Anonymous
/voici cette exo
Anonymous
Pour l chiffre 5 3 10 0
Anonymous
psy4
Ибраги́м
psy4
He/she's probably asking help for homework 😅
Anonymous
Lol j parle pas anglais
Anonymous
Anonymous
Didn't even read the rules
psy4
Hi Shelly
Anonymous
Anonymous
Français svp
psy4
You're not a bot? 😃
Anonymous
psy4
I don't know 😅
psy4
I get bot vibes from you 😁
Anonymous
Me?
Anonymous
Il ya qlq qui parle en français ici?
psy4
You're from Shelly?
Ибраги́м