Click here to Skip to main content
15,867,308 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTrying to Disable string operator= Pin
ForNow8-Jan-23 16:55
ForNow8-Jan-23 16:55 
AnswerRe: Trying to Disable string operator= Pin
k50548-Jan-23 17:49
mvek50548-Jan-23 17:49 
GeneralRe: Trying to Disable string operator= Pin
ForNow8-Jan-23 18:02
ForNow8-Jan-23 18:02 
AnswerRe: Trying to Disable string operator= Pin
Victor Nijegorodov8-Jan-23 22:50
Victor Nijegorodov8-Jan-23 22:50 
GeneralRe: Trying to Disable string operator= Pin
ForNow9-Jan-23 3:18
ForNow9-Jan-23 3:18 
GeneralRe: Trying to Disable string operator= Pin
Victor Nijegorodov9-Jan-23 3:56
Victor Nijegorodov9-Jan-23 3:56 
GeneralRe: Trying to Disable string operator= Pin
ForNow9-Jan-23 3:59
ForNow9-Jan-23 3:59 
AnswerRe: Trying to Disable string operator= Pin
CPallini8-Jan-23 23:20
mveCPallini8-Jan-23 23:20 
I compiled, with Visual C++ 2022, and run (successfully) the following code:
C++
#include <iostream>
using namespace std;

typedef unsigned char BYTE;

struct source
{
  string stmt;
  string loc;
  string addr1;
  string addr2;
};


// converts character array
// to string and returns it
string convertToString(unsigned char* a, int size)
{
    int i;
    string s = "";
    for (i = 0; i < size; i++) {
        s += a[i];
    }
    return s;
}


int main()
{

  BYTE statementnumber[4];

  source * returnsource = new source;

  returnsource->stmt = convertToString(statementnumber, 4);

  delete returnsource;
}

"In testa che avete, Signor di Ceprano?"
-- Rigoletto

GeneralRe: Trying to Disable string operator= Pin
ForNow9-Jan-23 1:38
ForNow9-Jan-23 1:38 
QuestionWhere to find connect declaration of this mysql instace Pin
coco2437-Jan-23 13:29
coco2437-Jan-23 13:29 
AnswerRe: Where to find connect declaration of this mysql instace Pin
RedDk7-Jan-23 15:35
RedDk7-Jan-23 15:35 
AnswerRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan7-Jan-23 21:06
mveRichard MacCutchan7-Jan-23 21:06 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2438-Jan-23 1:27
coco2438-Jan-23 1:27 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan8-Jan-23 1:37
mveRichard MacCutchan8-Jan-23 1:37 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2438-Jan-23 1:58
coco2438-Jan-23 1:58 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan8-Jan-23 3:04
mveRichard MacCutchan8-Jan-23 3:04 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2438-Jan-23 5:53
coco2438-Jan-23 5:53 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan8-Jan-23 22:28
mveRichard MacCutchan8-Jan-23 22:28 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2439-Jan-23 10:21
coco2439-Jan-23 10:21 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan9-Jan-23 21:50
mveRichard MacCutchan9-Jan-23 21:50 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco24310-Jan-23 4:10
coco24310-Jan-23 4:10 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan10-Jan-23 5:29
mveRichard MacCutchan10-Jan-23 5:29 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco24310-Jan-23 6:03
coco24310-Jan-23 6:03 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan10-Jan-23 6:42
mveRichard MacCutchan10-Jan-23 6:42 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco24310-Jan-23 8:12
coco24310-Jan-23 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.