I tried to initialize Structure class's member variables using function from StructureMaker class's function. It gives error. What is the problem with it? Can't I do so? Then how to do it?
MyMemberNotToInitThroughConstructor.h
#ifndef MYMEMBERNOTTOINITTHROUGHCONSTRUCTOR_H_
#define MYMEMBERNOTTOINITTHROUGHCONSTRUCTOR_H_
namespace my {
class MyMemberNotToInitThroughConstructor {
public:
    MyMemberNotToInitThroughConstructor(int no1);
    virtual ~MyMemberNotToInitThroughConstructor();
//private:
    int no;
};
} /* namespace my */
#endif /* MYMEMBERNOTTOINITTHROUGHCONSTRUCTOR_H_ */
MyMemberNotToInitThroughConstructor.cpp
#include "MyMemberNotToInitThroughConstructor.h"
namespace my {
MyMemberNotToInitThroughConstructor::MyMemberNotToInitThroughConstructor(int no1) {
    no = no1;
}
MyMemberNotToInitThroughConstructor::~MyMemberNotToInitThroughConstructor() {
    // TODO Auto-generated destructor stub
}
} /* namespace my */
Structure.h
#ifndef STRUCTURE_H_
#define STRUCTURE_H_
#import "MyMemberNotToInitThroughConstructor.h"
namespace my {
class Structure {
public:
    Structure();
    void setElements1(int id1);
    void setElements2(MyMemberNotToInitThroughConstructor* member1);
    virtual ~Structure();
//private:
    int id;
    MyMemberNotToInitThroughConstructor*member;
};
} /* namespace my */
#endif /* STRUCTURE_H_ */
Structure.cpp
#include "Structure.h"
namespace my {
Structure::Structure() {
}
void Structure::setElements1(int id1)
{
    id = id1;
}
void Structure::setElements2(MyMemberNotToInitThroughConstructor* member1)
{
    member = member1;
}
Structure::~Structure() {
    // TODO Auto-generated destructor stub
}
} /* namespace my */
StructureMaker.h
#ifndef STRUCTUREMAKER_H_
#define STRUCTUREMAKER_H_
#import "Structure.h";
#import "MyMemberNotToInitThroughConstructor.h"
namespace my {
class StructureMaker {
public:
    StructureMaker();
    void makeStructure(Structure*st);
    void innerMake(Structure*st);
    virtual ~StructureMaker();
};
} /* namespace my */
#endif /* STRUCTUREMAKER_H_ */
StructureMaker.cpp
#include "StructureMaker.h"
namespace my {
StructureMaker::StructureMaker() {
    // TODO Auto-generated constructor stub
}
void StructureMaker::makeStructure(Structure*st)
{
    int id1 = 123;
    st->setElements1(id1);
    innerMake(st);
}
void StructureMaker::innerMake(Structure*st)
{
    int no1 = 987;
    MyMemberNotToInitThroughConstructor my(no1);
    st->setElements2(&my);
}
StructureMaker::~StructureMaker() {
    // TODO Auto-generated destructor stub
}
} /* namespace my */
Test.cc
#include <stdio.h>
#include<iostream>
#include"StructureMaker.h"
#include"Structure.h"
using namespace std;
using namespace my;
int main()
{
    StructureMaker stm;
    Structure*st;
    stm.makeStructure(st);
    //cout << st->member->no << endl;
    return 0;
}
 
     
    