Category : c++

int employeeCount(); // hold the value of employee count int daysAbsent (int employeeCount); // hold the value of days missed double avgDaysAbsent(int numEmployee, int totalAbsentDays); // calculates average absent days int main(int argc, char** argv) { // Declare variables int totalEmployees(); int absentDays(); double averageAbsent(); // Call for a function averageAbsent() std::cout << "The average ..

Read more

I have a C++ module that I use with pybind11 to expose functionality in python. It all works nice, for example I am exposing classes, functions and enumerations from the C++ code, for example: py::class_<MapErrorMsg>(m, "MapErrorMsg") .def(py::init()) .def("SetFilename", &MapErrorMsg::SetFilename) .def("GetFilename", &MapErrorMsg::GetFilename) .def("SetWarnLevel", &MapErrorMsg::SetWarnLevel) .def("Warn", (void (MapErrorMsg::*)(MapErrorState, std::string, std::string)) &MapErrorMsg::Warn, "Warn with a level and two ..

Read more

I am new to OpenACC and I am writing a new program from scratch (I have a fairly good idea what loops will be computationally costly from working in a similar problem before). I am getting an "Undefined reference" from nvlink. From my research, I found this is because no device code is being generated ..

Read more

I am trying to teach myself c++. On Sololearn I have a task, which is You are making a program for a bus service. A bus can transport 50 passengers at once. Given the number of passengers waiting in the bus station as input, you need to calculate and output how many empty seats the ..

Read more