title: how can i use pointer to move inside of this array (function) instead of array subscribting
body: <p>my question is at the generate acronym function, how can i make this function work in a pointer arithmetic way instead of array subscripting.
  without messing up with the structures itself, the prof prhobited array subscribting so i have to do it with pointer arithmetic instead, anyone can land a hand?</p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS 
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  
  #define B 2
  #define N 8
  typedef struct {
  
      int course_id;
      int course_quota;
      char course_name[50];
      char course_code[6];
      char course_acronym[N];
  }course_t;
  
  void generate_course_code(char *course_code, int course_id);
  void generate_course_acronym(char *, char *);
  void display();
  course_t courses[B];
  int main() {
      int i;
      for(i = 0; i &lt; B; i++) {
          printf("Enter the course name: ");
  
          fgets(courses[i].course_name, sizeof(courses[i].course_name), stdin);
          generate_course_acronym(courses[i].course_name, courses[i].course_acronym);
  
  
          printf("Enter the course Quota: ");
          scanf("%d", &amp;courses[i].course_quota);
  
          while ('\n' != getchar())
          {
  
          }
          courses[i].course_id = i;
          generate_course_code(courses[i].course_code, courses[i].course_id);
  
  
      }
      display();
  
  
      return 0;
  }
  
   void generate_course_code(char *course_code, int course_id) {
      char str[6];
      course_id++;
      strcpy(course_code, "CSE");
      if (course_id &lt; 10) {
  
          sprintf(str, "0%d", course_id);
      }
      else
          sprintf(str, "%d", course_id);
      strcat(course_code, str);
  
  } 
  
  
  
  void generate_course_acronym(char *course_name, char *course_acronym) {
  
      int j = 0;
      char *p = course_name;
      for (course_acronym[j++] = toupper(*p); *p != '\0'; p++) 
          if (*p == ' ') course_acronym[j++] = toupper(*(++p));
          course_acronym[j] = '\0';
  
  } 
  
  
  void display() {
      int x;
  
      for (x = 0; x &lt; B; x++) {
          printf("%d. %s - %s  (%s) - %d \n", ++courses[x].course_id, courses[x].course_code, courses[x].course_name, courses[x].course_acronym, courses[x].course_quota);
  
  
      }
  
  } 
  </code></pre>