Luka🇺🇦
Hussein
Hussein
except for myself who didn’t know this group existed back then 😅
ÐΞΛÐ HΛϾКΞЯ
● Igor
Anonymous
Gio
Hi guys
Noah
Hi
浩
Hello, How can I detect whether a file stream/string stream is open with binary mode?
浩
I have a class with text/bianry io implement, I wonder what is a good interface. I think I should use stream as interface, but I need to detect stream binary/text attribute to detect which method to call.
Lyroy
Hello, is CMake considered off-topic?
klimi
Hello, is CMake considered off-topic?
You can ask to some extend here... it shouldn't be cmake only group tho, but i don't think you would get in trouble for asking since cmake is really related to C and C++.
klimi
alternatively you can just ofcourse ask in the offtopic group
Lyroy
Okay, thanks 👍
So, I'm making a small library with which (simplifying) I can call a function and execute a program/command. Example:
auto r = Execute("echo hello");
r.stdOut will be hello.
I have the basic setup with CMake. I managed to add a testing folder and make it work but I have a little problem.
For testing I would like not to rely on the OS programs, but rely on some programs written by me. I want that every time I generate the testing executable other executables are generated, one from each .cpp file in a determined folder.
I tried with a foreach but it kept giving me errors, how should I do this?
Anonymous
try to do some gdb, make a breakpoint and run it, checked up
Anonymous
or don't use the for_each, find a way to replace it
Lyroy
Hussein
● Igor
I replaced all my raw pointers with shared_ptr's and I'm using only make_shared, but something strange is happening...
After all variables going out of scoped, I'm having 84 constructor calls (expected), but only 14 destructor calls
https://pastebin.com/Zh7Yv9YL
tasya
//This is a program to identify the function calls using call by reference
#include<iostream>
using namespace std;
void funct_ref(int &z1, int z2); //function prototype
int main()
{
int x = 1;
int y = 1;
funct_ref(x, y); //call function
cout<<"x is "<<x<<endl;
cout<<"y is "<<y<<endl;
}
void funct_ref(int &z1, int z2) //function definition
{
z1++;
z2++;
}
tasya
can anyone explain to me why the x=2
\Device\NUL
\Device\NUL
z1 is referencing to x
tasya
i seee
tasya
#include <iostream>
using namespace std;
intmain()
float Area_of_rectangle(float length,float width)
{
float area;
area= length * width;
return(area);
}
Anonymous
Lyroy
Anonymous
#include<iostream>
using namespace std;
int main()
{
float salary,Incometax,pension,Netsalary;
cout<<"Please enter the salary";
cin>>salary;
if(salary>=3500)
{
Incometax=20%*(salary);
pension=4%*salary;
Netsalary=salary-pension-Incometax;
}
else if(salary>=2500)
{
Incometax=15%*salary;
pension=4.0%*salary;
Netsalary=salary-pension-Incometax;
}
else if(salary>=1000)
{
Incometax=10%*salary;
pension=4%*salary;
Netsalary=salary-pension-Incometax;
}
else if(salary>=600)
{
Incometax=8%*salary;
pension=4%*salary;
Netsalary=salary-pension-Incometax;
}
else if(salary>=150)
{
Incometax=5%*salary;
Netsalary=salary-pension-Incometax;
}
else
{
Incometax=0;
Netsalary=salary;
}
}
klimi
Msd
Anonymous
Mybundlehost Team ️
Have I done something wrong?
Mybundlehost Team ️
Okay, if my post is not recommended please let me know
Anonymous
Mybundlehost Team ️
it's advertising + off-topic
I notice programmer are I here, so I decided to bring our company brand over here, my apologies please if I have violated any rules
Mybundlehost Team ️
Okay noted, hope I could post more of this ?
Mybundlehost Team ️
But besides my company is registered we don't post irrelevant things
klimi
Anonymous
Mybundlehost Team ️
İbn
void print1 (char m, int x);
void print2 (int y);
void main ()
{
print1('x' ,3); xprint1(char x, int x)
}
void print1(char m, int x)
{
if(x>1)
{
print1(m ,x--);
cout<<m<<x;
print2 (x);
}
}
void print2(int x)
{
if (x>=0)
{
cout<<x;
print1 ('A' , --x);
}
else
cout<<"B";
}
İbn
İbn
İbn
Yanwardo Florensius
我是大娃
why foreach slower than normal for loop?
Yanwardo Florensius
我是大娃
test it
我是大娃
use benchmark
а
Pavel
When optimizations enabled it should be same in speed
我是大娃
no, I use g++ -O2, not work
我是大娃
same program, one is 14000ns, another is 4000ns
Pavel
Will be interesting to see your case, because when I tested it I haven't seen noticeable differences
我是大娃
no. only one benchmark
我是大娃
lib
Yanwardo Florensius
guys, it's an advanced problem which i have never learned before. I will continue to listen
我是大娃
for (auto _ : state)
{
for(int i = 0; i < 8; i++)
//for(const auto &key : m_vecBranchSecFee)
{
const auto &key = m_vecBranchSecFee[i];
我是大娃
code like this
我是大娃
SUMIT
how can i learn java online ?
is there any free source on youtube ..
plzz do rply
Moouuaaddhh
Shao
Maybe it's because there are so many things to deal with. For example, you have too many events. The for loop seems to be a basic loop
我是大娃
Maybe I get it. the complier does some optimizations, such as unroll
Pavel
Pavel
itsmanjeet
Hey anybody familiar with linux inotify api
I want to set the event-mask for IN_MOVE_TO to trigger after the moving or copying complete
But it calling during the copying process causing error: Text file busy and multiple calls for same event untile the copy complete
mito
itsmanjeet
👍 most probably