Created
May 22, 2020 04:36
-
-
Save vquaiato/275d2ac9c996421348be438ae1c9ecd6 to your computer and use it in GitHub Desktop.
passing arrays to functions cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
void foo(string meu_array[], int size) | |
{ | |
for(int i = 0; i < size; i++){ | |
cout << " " << meu_array[i]; | |
} | |
} | |
int main() | |
{ | |
string msg[3] = {"Hello", "Array", "World!"}; | |
foo(msg, size(msg)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment