Y
Y
yuharu2015-05-29 21:18:07
C++ / C#
yuharu, 2015-05-29 21:18:07

How to output in textbox with ASCII characters?

for (int i=0; i<n2; i++) // перевод в тип char зашифрованных данных
        cod[i]=char(codtext[i]);
textBox4->Text = gcnew System::String(cod, 0, n2);

Here is part of the code. The problem is that unicode characters are displayed in the textbox (if I'm not mistaken), and I only need ASCII. I'm using Visual Srudio 2012. What can I do?
PS The codtext array contains numbers in the range from 0 to 255.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jackroll, 2015-05-29
@jackroll

char ascii[255];
std::string result; // #include <string>
for(int i = 0; i < 255; i++)
{
  ascii[i] = i;
  result.append(ascii[i]);
}
textBox4->Text = result;

PS What is it, Visual C++?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question