/**
 * File: live_session.c
 * Written by Lisa Yan
 * ---------------------
 * Example problems from slides (Lecture 06)
 */
#include <stdio.h>
#include <string.h>

/*********************** C to English **********************/
// int c_to_english() {
//   int arr[] = {3, 4, -1, 2};
//   int *ptr = arr;
//   int *elt0 = *arr;
//   int elt = *(arr + 3);
// }

/************* Implementation: get_total_strlen() **********/
size_t get_total_strlen(char *strs[], size_t num) {
  size_t tot = 0;
  for (int i = 0; i < num; i++) {
    // TODO: fill this in
  }
  return tot;
}

/*************************** sizeof ************************/
void fn_print_sizeof(char *strs[]) {
  // printf("get_total_strlen: sizeof(strs): %zu\n", sizeof(strs));
}

/********************* skip_spaces *************************/
void skip_spaces(char **p_str) {
  int num = strspn(*p_str, " ");
  *p_str = *p_str + num;
}


int main(int argc, const char *argv[]) {
  /* Implementation: get_total_strlen() */
  // puts all strings on the stack
  char str0[] = "Luke";
  char str1[] = "I am";
  char str2[] = "your dad";
  size_t num = 3;
  char *arr[num];
  arr[0] = str0;
  arr[1] = str1;
  arr[2] = str2;

  printf("Total strlen: %zu\n", get_total_strlen(arr, num));


  /* skip_spaces */
  // char *str = "  Hi!"; 
  // skip_spaces(&str);
  // printf("%s", str); // "Hi!"
  // printf("\n");


  /* sizeof */
  // sizeof exercise
  // printf("main: sizeof(arr): %zu\n", sizeof(arr)); // format is for size_t
  // fn_print_sizeof(strs);

  return 0;
}
