i dont understand b/c i didnt use "new" in my program. it says new is in "xmemory" idk what that does but it is an include and i dont think i sould change it. as for my profileNode class it doesnt use ether one as far as i can tell. this would be the first class i wrote in c++ (to be used as a part not as main) so i coudl have messed it up. its all in the .h file.
.h file
Code:
#pragma once
#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
ref class profileNode
{
public:
int lineNumber;
char* projectName;
bool read;
int saveOptions;
char* lastSubject;
char* lastCondition;
profileNode(void)
{
lineNumber = -1;
projectName = "none";
read = FALSE;
saveOptions = -1;
lastSubject = "none";
lastCondition = "none";
}
profileNode(int last, char* name)
{
lineNumber = last++;
projectName = (char*) malloc(sizeof(char) * (strlen(name)+1));
strcpy(projectName, name);
read = TRUE;
saveOptions = 1;
lastSubject = "ss#0000";
lastCondition = "NONE";
}
profileNode(int line, char* name, bool read1, int save, char* subject, char* condition)
{
lineNumber = line;
projectName = (char*) malloc(sizeof(char) * (strlen(name)+1));
strcpy(projectName, name);
read = read1;
saveOptions = save;
lastSubject = (char*) malloc(sizeof(char) * (strlen(subject)+1));
strcpy(lastSubject, subject);
lastCondition = (char*) malloc(sizeof(char) * (strlen(condition)+1));
strcpy(lastCondition, condition);
}
#pragma endregion
public: bool compareNode(char* name)
{
//go thought linked list to find the node we want
if(strcmp(name, this->projectName) == 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
};
.cpp file
Code:
#include "StdAfx.h"
#include "profileNode.h"