| |

VerySource

 Forgot password?
 Register
Search
View: 670|Reply: 2

Novice problem, hurry! About CString

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-15 11:30:01
| Show all posts |Read mode
A CString stores numbers, such as 999999999999
How do I split it into 3 segments and split it into three numbers 9999, 9999, 9999


Ask for help, very urgent!
Reply

Use magic Report

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 Invalid IP Address

Post time: 2020-4-15 15:30:01
| Show all posts
CString strTotal ("999999999999");
CString str1, str2, str3;
   
str1 = strTotal.Mid (0, 4);
str2 = strTotal.Mid (4, 4);
str3 = strTotal.Mid (8, 4);
Reply

Use magic Report

1

Threads

27

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-4-15 22:15:01
| Show all posts
CString ID;
ID = "999999999999";
char Buf [4];
for (int i = 0; i <4; i ++)
{
Buf [i] = ID.GetAt (i);
}
Anyway, okay
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list