Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • struct Info studentInfo = {"99999", "firs", "las", {'0','1'}, {'0','7'}, {'1','9','9','3'} }; Commented Dec 8, 2014 at 21:01
  • This is actually what I was looking for. Commented Dec 8, 2014 at 21:14
  • actually, losing the last chard of each text is NOT a good solution. Rather make the initializer similar to: struct Info studentInfo = {('9','9','9','9','9','9'), etc }; However, the printf() statements for the values will also need to number of char to print, as in: printf("%-15s %6s \n", "Student ID:", studentInfo.studentID); Commented Dec 8, 2014 at 22:26
  • I removed last char for first/last name because the other option was to change the structure. Actually, char lastName[4]; must be modified to more realistic value - e.g. 20-30 chars instead of 4. Commented Dec 9, 2014 at 8:22