Anonymous
Anonymous
dude can anyone check my question, its really irritating and i wasted 1hr on this
Anonymous
Kqixs
The answer is 042
I found that out, I just asked if it's possible to do that with programming
Asdew
Danya, you just have to accept it, this time you're the one who doesn't understand.
Kqixs
I understand, no further discussion is required
Anonymous
YK Y
Anonymous
What's the issue?
"prashant scored less than 40% which is 0" here at 0 I want lowest percentage...
Francisco
/notes
Francisco
https://stackoverflow.com/help/minimal-reproducible-example
Anonymous
if the percentage is less than 40% it should print the %
Anonymous
Anonymous
Have you read the rules?
Anonymous
Use pastebin
Anonymous
correct last printf:
printf("%s scored less than 40%% which is %d", d_name, d_marks);
Anonymous
Anonymous
Anonymous
Anonymous
not working
you MUST always specify double % in printf to print a single %
Anonymous
https://pastebin.com/WM2peCbZ here is the code
Anonymous
Anonymous
not working
do you know about integer calculations?
1/2 == 0
1/2 * 2 == 0
...
Sid Sun
Sid Sun
It's a little complicated, to give it that image or text and do it OFC
Sid Sun
But you can make it into data that can be understood by an algorithm and try to solve it that way, it's complicated but it is not impossible
Anonymous
Anonymous
Solved🙌
Dima
what
Dima
bruh
Marián
char[] vs char* any articles?
Marián
i basically know that char[] is faster (ON STACK) and cannot be created with size based by variable (size has to be known at compilation time)
Marián
what if i want to implement some string algorithms? is it better to create large char[] and do any overflows / create muliple arrays or something like that?
Marián
i mean for example i want to manipulate text read from file
Dima
Marián
is it good thing to create like char[100] buffer and manipulate that?
Dima
just like Unreal engine and id Tech 4, they have multiple string classes
Dima
one is based on a stack, the other one is on a heap for large strings
Dima
Marián
so basically if i want to do something like simple RLE compression
Marián
i can do [] buffering quite easily
Marián
and its "best" approach?
Dima
yes you can
Dima
but if a large string comes you better be hoping for good
Dima
lol
Marián
Anonymous
You learn C or C++?
Marián
like
buffer 100 chars
count RLE
- if they are all same, don't reset counter
seek file
repeat
Marián
You learn C or C++?
don't really have time for that but trying to, mainly doing c# / rust and that kinda stuff
Anonymous
Use std::string
Marián
if I done something in c++ it was mainly opengl
Anonymous
Marián
what if it's just C
Anonymous
Then F
Marián
i am looking for low level
Marián
is std::string heap or stack based?
божн бляьь відкрий нахуй двері я галсту забув
22 chars stack and more are heap
Anonymous
It is heap based
In modern implementations if string is small enough, it is stored in stack
Anonymous
Marián
can't i create like std::string with bigger capacity than 22 based on stack?
Anonymous
Marián
i mean, what if i want to implement some algorithm as fast as possible and want to use like 200 char buffer
Marián
then std::string may be kinda slow?
Marián
(slower than messing around with char[] )
Mar!o
божн бляьь відкрий нахуй двері я галсту забув
it is easier to understand
Marián
Anonymous