- How did you make out with the challenge?…I hope you were able to understand arrays a little better.…Let me go ahead and walk through my solution to the problem.…So I'm going to start by creating a new project.…And I'm going to call it rainbow.…Because I want my array to be of type string,…I need to make sure I include the string library.…

And I want to add my using namespace.…Now in my main function, this is where I'm going to…declare my rainbow.…So let's go ahead and say string rainbow.…And I need to specify the size, so I'm going to say…that rainbow is going to have seven values.…We can use an initialization list.…Let me show you what that would look like.…So I'm going to do it twice.…

I'm going to do string rainbow,…and then I'll add string rainbow2.…And when I use an initialization list,…I don't have to specify the size.…So we're going to go ahead and put in our values,…so red, orange, yellow, green, blue, indigo, and violet.…

Now to add values to my string rainbow,…I can do that by specifying the name of the array,…

Resume Transcript Auto-Scroll

Author

Released

4/24/2017

Are you interested in adding programming skills to your professional toolkit? If so, whether you're a student kicking off your career, a mid-level manager who's always wanted to learn programming, or even a seasoned developer interested in tackling a new language, then this course is for you. Follow Peggy Fisher as she explains how to get started with C++, a core programming language. Using C++ 11, Peggy covers the basics such as how to compile and run C++ programs, and how to create variables. She also dives into working with data, as well as decision statements, creating functions, and using arrays. To help you grasp the material, she challenges you to write programs that include the aforementioned features.