write a c program to
Create an array of character strings and fill it with arbitrary strings of your choice. Pass it into a function named
“printStrings”. It should print all the strings inside the array. Note: You need to create an array of type char*.
[3:32 AM]
please help me in this
#include <stdio.h>
void printStrings(char** data, int size)
{
int i;
for(i=0; i<size; ++i)
{
printf("%s\n", data[i]);
}
}
int main()
{
char* data[] = {"To", "be", "or", "not", "to", "be", "that", "is", "the", "question"};
int size = sizeof(data) / sizeof(data[0]);
printStrings(data, size);
return 0;
}
Comments
Leave a comment