O
O
OCCASS OCCASSOVICH2020-07-26 13:51:21
C++ / C#
OCCASS OCCASSOVICH, 2020-07-26 13:51:21

How to pass a string to a function parameter?

Hello everyone, how can I pass an argument to a function as a string? Something like this? But to me the error is I can't pass the string.
void foo(char a[]) {}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
olkhovich, 2020-07-26
@olkhovich

void foo(std::string str) {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question