A
A
always_drunkking2021-07-05 16:47:08
C++ / C#
always_drunkking, 2021-07-05 16:47:08

How to add characters to the end of char?

there is a program that works with processes
and here is a piece of code

char processname[64];
cout << "Введите процесс" << endl;
cin >> processname;

I need to add
something like .exe to what I entered
cout << "Введите процесс" << endl;
cin >> processname;
processname = processname + ".exe"

Of course, I understand that it doesn’t work like that, but still, how to add char to the end of char ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
LoliDeveloper, 2021-07-05
@always_drunkking

Use memcpy().

R
rPman, 2021-07-05
@rPman

C++ has had full-fledged (and therefore slow, but not in implementation, but ideologically) strings for a very long time, the string class with which and + will work and syntactically convenient

K
Ketchuuuup, 2021-07-05
@Ketchuup69

find where in processname '\0' and copy ".exe" there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question