title: How to fix "using uninitialized memory" in C
body: <p>Writing a program when learning sequential list, now I want to achieve a search function, but it keeps telling me "List" and "books_info" are using uninitialized memory. </p>
  
  <p>I'm confused: I already defined that in my main function.</p>
  
  <pre class="lang-c prettyprint-override"><code>typedef struct {
      char ISBN[14];
      char name[MAXSIZE];
      float price;
  } Book;
  
  typedef struct {
      Book* elem;
      int length;
  } SqList;
  
  // ...
  
  int main() {
      SqList List;
      Book books_info;
  
  // ...
  
          switch (switch_option) {
          case 3:
              printf("Please input a number: ");
              scanf("%d", &amp;search);
  
              temp = GetElem(List, search, books_info);
  
  // ...
  </code></pre>