Please help me with this.

I am a newbie at this.

I am supposed to pass a string array to a function. Letter grade Please give me an example on how to do it plz.

thanks in advance.

Recommended Answers

All 3 Replies

Write your function to take a parameter that is a char array.

When you call the function, use only the char array's name, no indexing.

When you've done this, please show the code and we'll provide further assistance.

You will also probably want to send the size of the array, unless you plan on writing an algorithm to look for the null terminator.

Please help me with this.

I am a newbie at this.

I am supposed to pass a string array to a function. Letter grade Please give me an example on how to do it plz.

thanks in advance.

What do you mean,
an array of strings?
og just a string

have you simple tried

int fun(std::string name);
int fun(*std::string names);
int fun(std::vector<std::string> names);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.