P
P
Pavel Padozhnikov2015-11-03 21:19:13
Programming
Pavel Padozhnikov, 2015-11-03 21:19:13

How to print string and argument without space?

How can you "glue" an argument to a string?
For example, in LUA you can do this:

i = "abc"
print("123"..i) --> "123abc"

How is this implemented in C or C++?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Snytkin, 2015-11-03
@PaveL152

Can the same

std::string s = "abc";
std::cout << "123" + s;

Or you can use printf
For std::cout, you need to connect iostream, for printf - cstdlib

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question