| |

VerySource

 Forgot password?
 Register
Search
View: 1473|Reply: 13

How to convert a CString string to a char for writing? ?

[Copy link]

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-2-8 06:30:02
| Show all posts |Read mode
How to convert a CString string to a char for writing? ?
Please master answer! !!
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-3-29 22:15:01
| Show all posts
Everyone help out! !! Urgent use! !!
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-30 18:15:01
| Show all posts
Is it possible to convert CString to char *?
If yes: then you can use GetBuffer () of CString object
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-3-30 21:30:01
| Show all posts
Please give pointers! !!
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-31 00:30:01
| Show all posts
Or this:
CStirng str = "This is a string";
char * p;
p = (LPTSTR) (LPCTSTR) str;
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-31 06:15:01
| Show all posts
Am i wrong
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-3-31 13:45:01
| Show all posts
Transformed, but it is wchar_t, how can he assign it to string?
CString aa = "kdas123";
string bb;
 bb = aa.GetBuffer (); shows the binomial operator '=': the operator of the right operand of the form 'wchar_t *' was not found!
What to do?
Reply

Use magic Report

0

Threads

4

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-31 21:38:15
| Show all posts
Try getat ()
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Unknown

Post time: 2020-4-1 06:45:01
| Show all posts
Is there a string in MFC?
I don't know, can't help you
Reply

Use magic Report

1

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-4-1 13:30:01
| Show all posts
Please help me to see and answer!
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