Alex
yes
Krypton
yes
oh i see
Vlad
lmao. second grade homework?
Talula
What is this math problem?
Alex
please stop offtop
Talula
Probably yes
So why are you posting it?
Pavel
Anyone ???
I don't understand your question. You have a loop and a function call, what do you want? Do you want us to imagine what the implementation of the function should be to solve the task that we don't know? Then return 8
Hadaward 'Solly'
Anyone ???
reformulate your question
Gulshan
reformulate your question
I have a new question, it got my answer by hit and trial
Anonymous
/warn learn to paste your code
Anonymous
paste.ubuntu.com Read the rules
Anonymous
/warn
hazer_hazer
Hi, everyone. I'm writing logger for debugging. I have 6 log function (verbose, debug, info, etc.) Now I want to add variadic templates to make them callable for multiple args. But it does not link... template<typename Arg, typename ...Args> void Logger::log(LogLevel level, Arg && first, Args && ...other) { // ... std::cout << std::forward<Arg>(first); ((std::cout << ' ' << std::forward<Args>(other)), ...); } And each level-log function looks like: template<typename ...Args> void Logger::verbose(Args && ...args) { (log(LogLevel::Verbose, args), ...); }
hazer_hazer
Linker error looks like: undefined reference to `void Logger::verbose<char const*>(char const*&&)' Just if i'm trying to write logger.verbose("string")
hazer_hazer
What could I make wrong?
Anonymous
Can anyone suggest best dsa course for beginners to Advanced
Tangent Alpha
Tangent Alpha
ברני
not in every case
I didn't say all the time, sometimes while will work better. In the industry they want the code to be the shortest as it can
Tangent Alpha
My friends that working as coders said that as shorter the code is the better
for another coder to read the code yes, this statement is true but normally it is measured by time and memory complexity
Vlad
for loop is better than while
>ketchup is better than mustard
Hadaward 'Solly'
use whatever is more straightforward
Hadaward 'Solly'
care about optimizations later
Hadaward 'Solly'
solve the problem and then make the solution better. That's the right order.
Vlad
In a lot of cases it will be enough if it does the job
Tangent Alpha
Anonymous
😊✋
Anonymous
Hi everyone
hazer_hazer
.inl files are for that
Never used them)
Vlad
You just include them at the end of your .h file
Vlad
That's if you bother to segregate interface and implementation
hazer_hazer
Yeah, I read a little bit about them. But why I can put definition of template in header file, but not in definition file... If linker links declaration and definition of raw-defined funcs, why not just to link templated and inline funcs?
Vlad
They are just that "template"
hazer_hazer
Ah
Vlad
also inline funcs are legitimate way to violate ODR
The only disadvantage of both is that you have to compile them in every TU.
olli
@ollirz @Tazzmikar 🥺
You probably don't want to start at index 0 again. If you want to fill the remaining places you could start at userSize instead int morePlace(int arr[], int userSize, int size) { int counter = 0; for (int i = 0; i < size; i++) { ^^^^^^^^^^ also, you probably don't want to run these comparisons over and over again, running them once or size times doesn't change the outcome of the condition if (userSize != size) { // <omitted> } else if (userSize == size) { // <omitted> } Instead you could do something like this (pseudocode) if array is full: print message else: for every unused array element: ask for an element to fill it with fi
hazer_hazer
.inl files are for that
If I have project structure with include and src directories, should I put .inl files to include or to src? Or create new directory?
Anonymous
trabalho.c
Anonymous
I need help itens 5, 6 and 7
Anonymous
Anonymous
Anonymous
Hadaward 'Solly'
1. you send prints 2. you send multiple prints 3. you speak portuguese
Hadaward 'Solly'
if you have a large code to share, then put it in pastebin or similar and leave the link here
Hadaward 'Solly'
same.
Anonymous
Problem? 😶😶
Hadaward 'Solly'
just send the code if you didnt fix it yet
Anonymous
Ok, sorry.
Anonymous
Can someone tell why this error is coming again and again when I install mingw?
Hadaward 'Solly'
can you try another mirror
Anonymous
can you try another mirror
Can you explain how to do that? I'm beginner so I'm installing this by watching YouTube tutorials but this error is coming again and again.
Hadaward 'Solly'
send me the link of the tutorial you are watching
Hadaward 'Solly'
try running the installer as administrator
Zoro
void main { printf("Hello!"); }
olli
Can someone tell why this error is coming again and again when I install mingw?
I recommend to use either the distro from nuwen.net (https://nuwen.net/files/mingw/mingw-17.1.exe) or msys2 (https://www.msys2.org/) If you're running a recent windows version using WSL2 might be another good option
Abi
Balaguruswamy in c
Talula
Balaguruswamy in c
English please.
-Bs¬
😂 😂 😂 😂
-Bs¬
Balaguruswamy in c
This is an author name
gulshan
Hello
Ttfsefghh
Hello brother
Maanik
Hello