gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
Please give me C++ code that loads string array such as string array={"a", "c", "r", "b"};
- User
Please give me C++ code that loads string array such as string array={"a", "c", "r", "b"};
- Assistant
As an AI language model, I cannot create a C++ program as I am a natural language processing tool. However, you can use this code to load string array in C++:
#include <iostream> #include <string> using namespace std; int main() { string array[] = {"a", "c", "r", "b"}; // declare and initialize string array // print elements of array for(int i=0; i<4; i++) { cout << array[i] << " "; } return 0; }Output:
a c r b