-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemo
48 lines (36 loc) · 1.2 KB
/
memo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
1.compile ros:
~/catkin_ws
catkin_make
source devel/setup.bash
2. run ros
rosrun directory filename
rosrun c_scripts unit2_exercise
3. using namespace std; pour
string
cout
cin
endl
4. compile C++
g++ -std=c++11 boring_movie.cpp -o boring_movie_compiled
5.run C++
./boring_movie_compiled
6.
int* pointer; // non-constant pointer to non-constant integer
const int* pointer; // non-constant pointer to constant integer
int* const pointer; // constant pointer to non-constant integer
const int* const pointer; // constant pointer to constant integer
7.
int myarray[4] = {9,99,999,9999};
int* start = myarray;
int* stop = myarray + 4;
int* currentpointer = start;
while (currentpointer != stop) { ++(*currentpointer);
++currentpointer;
}
> 10,100,1000,10000
8.
float *RosbotClass::get_laser_full() {
float *laser_range_pointer = laser_range.data();
return laser_range_pointer;
}
/*This function called get_laser_full() is a function that returns a pointer (see the operator asterisk before the name of the class RosbotClass). What it does is take the values of a ROS vector called laser_range and assign them a pointer, then return this pointer. */