Adventures in C
If you’re more familiar with Python and you want to learn C you’ll need to tackle pointers…
Let’s look at an example :
The first thing you may notice is that there is no need for a “return” from the function….
Example 1 – Pointers
#include<stdio.h>
void tripler(int *p);
int main(){
int num = 5;
int *ptr;
ptr = #
tripler(ptr);
printf("%d",*ptr);
}
void tripler(int *p){
*p = *p * 3;
}