Asdew
There is no algorithm Just thinking
A computer sadly cannot think like we can.
Anonymous
A computer sadly cannot think like we can.
This question is not meant to be solved by computer
Kqixs
There is no algorithm Just thinking
It should be possible, though is it without making the program so lengthy?
Anonymous
dude can anyone check my question, its really irritating and i wasted 1hr on this
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
Asdew
So if you are so smart, give the "algorithm"
I never said that, I just said that you are the one who does not understand the question.
Anonymous
What's the issue?
"prashant scored less than 40% which is 0" here at 0 I want lowest percentage...
Anonymous
I never said that, I just said that you are the one who does not understand the question.
Again the question is bad because he doesn't understand that it can't be solved by computer if he doesn't give the specific limits to the problem
Francisco
/notes
Francisco
https://stackoverflow.com/help/minimal-reproducible-example
Anonymous
What's the issue?
aye you looking on it?
Francisco
"prashant scored less than 40% which is 0" here at 0 I want lowest percentage...
Write a minimal example that we can reproduce ourselves, and not a picture, as we can't copy & paste the code
Anonymous
if the percentage is less than 40% it should print the %
Anonymous
here the ques
Anonymous
Have you read the rules?
Anonymous
Use pastebin
Francisco
Have you read the rules?
I don't think he did...
Anonymous
correct last printf: printf("%s scored less than 40%% which is %d", d_name, d_marks);
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
not working
do you know about integer calculations? 1/2 == 0 1/2 * 2 == 0 ...
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
do you know about integer calculations? 1/2 == 0 1/2 * 2 == 0 ...
yeah i was doing mistake there but now i used float but i am getting 200 instead of 20 as answer
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
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
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
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
Marián
Use std::string
well don't want to use std xd
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
22 chars stack and more are heap
It is implemention defined
Marián
can't i create like std::string with bigger capacity than 22 based on stack?
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 implemention defined
22 chars is with clang
божн бляьь відкрий нахуй двері я галсту забув
It is implemention defined
оf course, i just want to give an example, just numbers
божн бляьь відкрий нахуй двері я галсту забув
it is easier to understand
Anonymous
i mean, what if i want to implement some algorithm as fast as possible and want to use like 200 char buffer
There's boost::container::small_vector where you can predefine elements count that will be stored on stack, but there's not any small_string