Hello,
I am currently programing in Visual C++. I am a C++ programmer, but I am not used to using visual Studios; code that works in PuTTy does not always work here.
For instance, in my .cpp file I have these two errors:
error C2784: 'bool std::operator ==(const std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem *)' : could not deduce template argument for 'const _Elem *' from 'TableColumnsItemType' c:\Users\A091250\HSQA\HSQA Applications\New_ForIneteractiveReports_Klinesmith\Report View Interface C++ version\Report View Interface C++ version\TableColumnsSortedLinkedList.cpp 72 Report View Interface C++ version
The second error is the same, except for '!=' and not '=='
//TableColumsSortedLinkedList.cpp
#include <string>
#include "TableColumnsSortedLinkedList.h"
void ColumnsSortedType::DeleteItem(TableColumnsItemType item)
{
NodeType* location = listData;
NodeType* tempLocation;
string dataName;
dataName = item.ReturnDataName();
// Locate node to be deleted.
if (dataName == (listData->info)) //Error is here!
{
tempLocation = location;
listData = listData->next; // Delete first node.
}
else
{
while (dataName != ((location->next)->info)) //And error here
location = location->next;
tempLocation = location->next;
location->next = (location->next)->next;
}
delete tempLocation;
length--;
}
// TableColumnsSortedLinkedList.h
#include "TableColumnsItemType.h"
#include <iostream>
#include <fstream>
//This is a class for a sorted, linked list. This data will be used in the listbox of form1. Makes used of TableColumsItemType.h
#include <string>
usingnamespace std;
struct NodeType
{
TableColumnsItemType info; //This part of node holds data
NodeType* next; //This part of node is a pointer to the next item in the list. Will use info-> next syntax to reference next item.
};
class ColumnsSortedType
{
NodeType *listData;
int length;
NodeType *currentPos;
//Function prototypes.....
};
Is it my pointers? I assume that there is a issue with comparing the datatypes, because I do have #include<string>
#pragma once
#include <string>
using namespace std;
class TableColumnsItemType
{
string visibleName;
string dataName; //dataName is string
public:
string ReturnVisibleName();
string ReturnDataName();
};
[/code]
Also, please note that my code has dataName declared as a local string variable, set to item.dataName for this purpose, and this appears to throw no error...?
Oh! I believe it's because I have have dataName pointed to; it is still pointing to TWO class memebers, not one. I forgot there were two.
Let me try to fix it, and see if that solves the issue.