What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-09-19 14:18:02
c++ print 3d cube
#include<gl/freeglut.h> double rot = 0;float matCol[] = {1,0,0,0}; void display(){ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glPushMatrix(); glRotatef(30,1,1,0); glRotatef(rot,0,1,1); glMaterialfv(GL_FRONT,GL_DIFFUSE,matCol);... Add solution -
C++ 2021-09-15 11:43:02
c++ ros publisher
#include "ros/ros.h" #include "std_msgs/String.h" /** * This tutorial demonstrates simple receipt of messages over the ROS system. */ void chatterCallback(const std_msgs::String::ConstPtr& msg) { ROS_INFO("I heard: [%s]&q... Add solution -
C++ 2021-09-14 16:12:02
vector of threads thread pool c++
namespace { std::vector<std::thread> workers; int total = 4; int arr[4] = {0}; void each_thread_does(int i) { arr[i] += 2; } } int main(int argc, char *argv[]) { for (int i = 0; i < 8; ++i) { // for 8 iterations, for (int j... Add solution -
C++ 2021-09-14 04:31:02
private and public in namespace cpp
#include <cstdio> #include "thing.hpp" int main(int argc, char **argv) { printf("%d\n", thing::getX()); // OK printf("%d\n", thing::getSum()); // OK printf("%d\n", thing::sum(1, 2)); // err... Add solution -
C++ 2021-09-10 12:21:02
defining class in other file in c++
//ClassOne.hpp: class ClassOne { public: ClassOne(); // note, no function body int method(); // no body here either private: int member; }; //ClassOne.cpp: #include "ClassOne.hpp" // implementation of constructor ClassOne::Class... Add solution -
Other 2021-09-10 01:18:02
sum using for loop in c
#include <stdio.h> #include <stdlib.h> #include <math.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int x,i,n,num, f = 1; doub... Add solution
Best helpers
Ranking is empty