Question

Write a declaration for a global array called words. Explain where the code should be placed...

Write a declaration for a global array called words. Explain where the code should be placed so it is global.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>

#include <iomanip>

using namespace std;

/* Here we are declaring the gobal string array

* whose name is words which is of size 50

*/

string words[50];

//Main function

int main()

{

return 0;

}

_____________________

We have to declare the global array before the main() function.The purpose of declaring as global variables is, we can access them from any where in our program.i.e we can access in main() function (or) we can access them in function implementations.

____________________Thank You

Add a comment
Know the answer?
Add Answer to:
Write a declaration for a global array called words. Explain where the code should be placed...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT