Skip to content

Instantly share code, notes, and snippets.

View gvnwltrs's full-sized avatar
🤪
...

Gavin Walters gvnwltrs

🤪
...
View GitHub Profile
@gvnwltrs
gvnwltrs / subscribe.py
Created February 9, 2021 21:02
Subscribe #ROS #Python
#!/usr/bin/env python
@gvnwltrs
gvnwltrs / pointers_and_arrays.c
Created January 8, 2021 21:31
Pointers and Arrays #C
### array that uses malloc
```
#include <stdio.h>
int main()
{
@gvnwltrs
gvnwltrs / multidimensional_array.c
Created January 8, 2021 21:30
Multidimensional Array #C
int main()
{
int a[5][5];
return 0;
}
@gvnwltrs
gvnwltrs / copy_array.c
Created January 8, 2021 21:29
Copy Array #C
int main()
{
int a[] = {1, 2, 3, 4};
int b[];
memcpy(b, a, 4*sizeof(int));
@gvnwltrs
gvnwltrs / Array.c
Last active January 8, 2021 21:28
Array #C
int main()
{
int arr[];
return 0;
}
// another array example
#include <stdio.h>
@gvnwltrs
gvnwltrs / Adding.cpp
Last active January 8, 2021 21:28
Adding #CPP
// adding up members of a collection
// accumulate(); uses the '+' operator to add up all members in a collection; sum tool; another template!
// can also use lambdas instead
vector<int> a = {1, 2, 3, 4, 5};
for (int i : a)