Dima
try it yourself
Dima
that’s how you practice
Anonymous
but i need help to know how to solve
Ashish Bhushan
Okk wait
klimi
#cs50
Anonymous
Anonymous
Okk wait
Thank you so much. And sorry i told whatever that came in my mouth. I take my words back sorry guys.
Anonymous
Ashish Bhushan
Let it be guys...we can do it once...from next time he should take care of it
Anonymous
Ashish Bhushan
Navin try to solve these questions by yourself....google it do some research it will only help you
MᏫᎻᎯᎷᎷᎬᎠ
Oh sorry, i was unknown of it.
+ you got your warn not because of your question
But because you broke one of the rules(not to get angry about not getting an answer)
Ashish Bhushan
Yes that's also a thing.... Don't abuse
Ashish Bhushan
Strictly don't abuse
Anonymous
okay
Anonymous
yes maam i read that before posting my query, so Klimi said it works only with whole numbers, i get that, thank you so much for ur reply.
but whys that ?
why wasnt it there back then,
bc it was complicated or was it not used before, i beleive it was because of compatibility issues? who knows? anyone ?
i can surely divide 1.4 with 1.1 and get 0.3 as my guy, my remainder, but what was the reason of not adding it back then.
Anonymous
👏🏼 claps, very well, got you.
Thank you! youre the best
klimi
klimi
but also the precision thingy
Anonymous
Anyone has good experience in c programming?
Asdew
Ask your question.
Dima
Lmao wtf
Anonymous
I need the idea of how to solve this problem
Asdew
This is the worst I've seen.
Anonymous
Dima
/warn lmao why is this so funny
klimi
Ashish Bhushan
Really is this happening rn...and no one is telling him
Ashish Bhushan
Aah here we come
Ashish Bhushan
🤣🤣🤣
MᏫᎻᎯᎷᎷᎬᎠ
😂😂😂😂
Ajay
Ajay
got that, auto it = map.insert({key, val});
it.second returns true if it is already present.Right?
Ajay
why doesn't auto work here, i need to write the entire type?
Anonymous
Ajay
Anonymous
Ajay
Ajay
Anonymous
You can do like this in C++17:
const auto [iter, inserted] = map.insert...;
Dima
nice
Ajay
no i don't
Anonymous
I don't there's something hard if you want just use it
Ajay
i figured out everything.chill.
Anonymous
Any examples?
Anonymous
Both
Anonymous
Yeah using auto for return type is 🤢 in most cases
I meant using auto for variables (except "reference" to bit in vector<bool>)
Is there any downsides?
Francisco
There's functions that you know what the result looks like, but you don't care about the exact type. For example, std::count clearly returns some integral type, but you normally don't really know which one, so just use auto and you should be good
Francisco
It's weird because other languages that don't require explicit typing don't have this discussion. I don't see many people complaining about Python not having explicit types at declaration, yet everybody is fine with it
Anonymous
I prefer almost always use auto for variables
Anonymous
What is S9?
professor
hey guys, how can I make a proof of concept for generation fuzzing based since it is more based on reversing / file format ?
Newly
Guys i need to call one class to another class is there any method. How to do it
Dima
Newly
#googleit
I tried but doesn't work for C++. That's why posted here.
professor
how can I validate if its xml or pdf or any other file format in c++?
Diego
Can anyone help me with an API creation?
This is the Encode process
____________________________________
int32_t text_7bit_encode(const char* txt_in, char* txt_out);
txt_in: null-terminated ASCII string to encode,
txt_out: 7-bit encoded string, null terminated
____________________________________
This is the decode process
____________________________________
int32_t text_7bit_decode(const char* txt_in, char* txt_out);
txt_in: null-terminated 7-bit encoded string,
txt_out: null-terminated decoded ASCII string, the function should return the size of the output data (>0) or error (<0).
_______________________________________
Anonymous
How do I replace E to $? Like in the picture
Ashish Bhushan
Read the array in which it is stored and ....put the condition that when it finds E replace it with dollar symbol
Anonymous
is it strncpy ?
Ashish Bhushan
No it copies the whole string
Ashish Bhushan
Wait lemme share a link
Ashish Bhushan
C Program to Replace All Occurrence of a Character in a String
https://www.tutorialgateway.org/c-program-to-replace-all-occurrence-of-a-character-in-a-string/
Ashish Bhushan
Here it's well explained in this page
Anonymous
Thanks ✨
Ashish Bhushan
😃
Kshitiz Pathak
How to understand and write recursion code? Can someone give me some tips for this?
Kshitiz Pathak
I find it little hard
Serenity
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
// Test cases: 5!! = 15; 10!! = 3840;
long factorial(int n) { // HERE: DEFINE THE RECURSIVE DOUBLE-FACTORIAL FUNCTION
if (n == 1)
return 1; // base case in which the calculation is obvious
else
return n * factorial(n - 1); // the recursive call
}
long doublefactorial(int n)
{
if (n < 0)
{
return 0; // verifying it is a positive integer
}
if (n == 1)
return 1; // base case
else
return factorial(n) / (doublefactorial(n - 1)); // the recursive call
}
Serenity
Can someone turn the second function into a tail-recursive function ( based on factorial function assuming it is correctly implemented ) ?
Serenity
Can someone help implement the function above ?