What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-07 04:50:13
c++ ros subscriber
#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 -
Other 2022-01-28 04:40:51
sdl render text
#include <stdlib.h> #include <SDL2/SDL.h> #include <SDL2/SDL_ttf.h> #define WINDOW_WIDTH 300 #define WINDOW_HEIGHT (WINDOW_WIDTH) /* - x, y: upper left corner. - texture, rect: outputs. */ void get_text_and_rect(SDL_Renderer *renderer... Add solution -
C++ 2021-11-18 14:41:15
increase the speed of cin and cout in c++
#include <iostream> int main(int argc, char **argv) { int parity = 0; int x; //you can use scanf , printf alternatively for speed std::ios::sync_with_stdio(false);// this increases the speed of i/o while (std::cin >> x) parity ^... Add solution -
C++ 2021-11-18 06:54:16
probability code c++
// this the c++ code for generating random numbers //pdf(x) = 1 if x>360 // = 0 if x<0 // = x/360 otherwise #include <iostream> #include <math.h> #include <stdlib.h> using namespace std; //This is a sample program t... Add solution -
C++ 2021-11-17 02:22:22
clock_gettime example
/* * This program calculates the time required to * execute the program specified as its first argument. * The time is printed in seconds, on standard out. */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <ti... Add solution -
C 2021-11-13 08:50:16
c read file from command line
#include <stdio.h> int main(int argc, char **argv) { for (int i = 0; i < argc; ++i) { printf("argv[%d]: %s\n", i, argv[i]); } } /* [birryree@lilun c_code]$ ./a.out hello there argv[0]: ./a.out argv[1]: hello argv[2... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5