array2d_2 - Todays Agenda 2DDimensionalArrays 03Apr2007 1...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 03 Apr 2007 Today’s Agenda 2-D Dimensional Arrays
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Computer Programming I TA C162 . 03 Apr 2007 Arrays of Strings Declaration:   char name[5][30]; Five strings each contains maximum thirty characters. Initialization: char[5][10]={“One”,”Two”,”Three”,”Four”,”Five”}; Other valid declarations char[][]={“One”,”Two”,”Three”,”Four”,”Five”}; char[5][]={“One”,”Two”,”Three”,”Four”,”Five”};
Image of page 2
3 Computer Programming I TA C162 . 03 Apr 2007 String Arrays: Reading and Displaying void main() { char name[5][30]; printf(“\n Enter five strings”); /* Reading strings */ for(i=0;i<5; i++) scanf(“%s”,name[i]); /* Printing strings */ for(i=0;i<5; i++) printf(“\n%s”,name[i]); }
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 Computer Programming I TA C162 . 03 Apr 2007 Problem 1: Array of Strings Problem Statement:   Write a C program that reads names of students and sort them in dictionary order.
Image of page 4
5 Computer Programming I TA C162 .
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern