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?
MᏫᎻᎯᎷᎷᎬᎠ
can you give us the entire message?
'return': cannot convert from 'std:: string' to 'T'
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
BinaryByter
look it up
BinaryByter
:)
MᏫᎻᎯᎷᎷᎬᎠ
Ok
Anonymous
I have no idea how I m start coding any one help me pls🙏
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😂
Luis José
Just do it
ShiaLbfVoice.mp3
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
Nvm
Anonymous
Lol
Kotak
no its still going in default
Anonymous
no its still going in default
Even when you input 2?
Kotak
its not asking for char value its directly going to default😅😅
Kotak
though i have used scanf i dont know why its directly going to default
Anonymous
though i have used scanf i dont know why its directly going to default
Printf the return value of scanf to see if there are.errors
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
Anonymous
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
It may have something to do with the way windows buffers the input, it might be taking in the "enter" key from the last scanf, print the value of "c"
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
S.
Will the program be faster
Generally yes. Just be aware of overheads.
Talula
Will the program be faster
Why use it as wrapper? Why don't you use something decent like C# for warpper?
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
psy4
psy4
He/she's probably asking help for homework 😅
Anonymous
Lol j parle pas anglais
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?
Ибраги́м
Il ya qlq qui parle en français ici?
That's it, you're off