Struct

oop uses pass by reference, but stuffs the struct with functions instead of having it in separate header file as per git repo. Below is a platformio program showing pass by reference but not embedding the function inside the struct. 
structest.cpp main file
//main file under platformio structstest.cpp
#include <Arduino.h>
#include "Mytypes.h"
// mods old 2010 c example for Arduino ccp environment
// https://forum.arduino.cc/t/passing-struct-to-function-again/45000 
ctresult dimmer1; //global variable
void setup() {
 // put your setup code here, to run once:
 dosomething(&dimmer1);
 Serial.begin(19200);
 Serial.print("Raw results:");
 Serial.println(dimmer1.raw_result);
}
void loop() {
 // put your main code here, to run repeatedly:
}
Mytpes.cpp
// file Mytypes.cpp 
#include <Arduino.h>
#include "Mytypes.h"
void dosomething(struct ctresult* r1){
 r1->cmd_ACK= 1;
 r1->raw_result = "M1:323:M2:435";
 r1->cmd_results[0] =323;
 r1->cmd_results[1] = 435;
}
Mytypes.h
// file Mytypes.h 
#ifndef Mytypes_H
#define Mytypes_H
struct ctresult;
struct ctresult {
 int cmd_ACK;
 String raw_result;
 int cmd_results[8];
}; 
//extern struct ctresult r1;
void dosomething(ctresult* r1);
#endif
=== links ===
oop, ipfs
 class vs struct, stackoverflow and Why is there not an std::is_struct type trait?