Skip to content

Instantly share code, notes, and snippets.

@MattBlack85
Created October 9, 2018 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattBlack85/d8e2d1dd553b5577783e697fd38179c6 to your computer and use it in GitHub Desktop.
Save MattBlack85/d8e2d1dd553b5577783e697fd38179c6 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stddef.h>
void foo(char **p, size_t lol);
void bar(char **p, size_t *lol);
void bar(char **p, size_t *lol) {
char method[] = "GET";
size_t lol_size = 50;
*p = method;
*lol = lol_size;
}
void foo(char **p, size_t lol) {
bar(p, &lol);
}
int main() {
char *myp;
size_t lol;
size_t len;
foo(&myp, lol);
if (lol == 50)
return 0;
else
printf("Value of lol is: %lu", lol);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment