Click here to Skip to main content
15,896,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Answerl am sorry! Pin
YuxiLv20-May-06 1:16
YuxiLv20-May-06 1:16 
QuestionHow to read parllel port Pin
mbkh_8419-May-06 15:56
mbkh_8419-May-06 15:56 
AnswerRe: How to read parllel port Pin
kk.tvm19-May-06 20:52
kk.tvm19-May-06 20:52 
GeneralRe: How to read parllel port Pin
Hamid_RT20-May-06 1:02
Hamid_RT20-May-06 1:02 
QuestionRounding up to a multiple of a number Pin
Remco Hoogenboezem19-May-06 11:03
Remco Hoogenboezem19-May-06 11:03 
AnswerRe: Rounding up to a multiple of a number Pin
Nibu babu thomas19-May-06 18:50
Nibu babu thomas19-May-06 18:50 
AnswerRe: Rounding up to a multiple of a number Pin
Laxman Auti19-May-06 19:11
Laxman Auti19-May-06 19:11 
QuestionProblem with Linked List Pin
CoffeeAddict1919-May-06 9:49
CoffeeAddict1919-May-06 9:49 
The end objective is to save a file to disk with data from a linked list. First this function converts the data already in the list into a buffer (string), which is sent along with the filename to another function (not listed here) so that the buffer is written to file. The problem is where I try to set the temporary variables which store the fields in the linked list so that they can be concatinated together into individual lines...to be later concatinated into the buffer (a c++ string). I'm getting this error 4 times from the compiler:

error C2110: '+' cannot add two pointers

The function with the problem:
<br />
void WeaveList::SaveToFile(string FileName)<br />
{<br />
	NodePtr currPtr = head; //Loop control pointer<br />
	bool WriteSucceeded = false;<br />
	string WeaveLine1,<br />
		   WeaveLine2,<br />
		   WeaveLine3,<br />
		   WeaveLine4,<br />
		   Buffer,<br />
		   tempWeaveName,<br />
		   tempExampleSizes;<br />
	double tempARMin,<br />
		   tempARMax = 0.0;<br />
	int tempNumRings = 0;<br />
<br />
	cout<<"Writing data to buffer..."<<endl;<br />
	if(!IsEmpty())<br />
	{<br />
		while(currPtr != NULL)<br />
		{<br />
			tempARMin = currPtr->AR_Range_Min;<br />
			tempARMax = currPtr->AR_Range_Max;<br />
			tempNumRings = currPtr->NumRingsUsed;<br />
			tempWeaveName = currPtr->WeaveName;<br />
			tempExampleSizes = currPtr->ExampleSizes;<br />
<br />
			WeaveLine1 = "Weave AR Range: " + "/t/t" + tempARMin + " - " + tempARMax;<br />
			WeaveLine2 = "Number of Rings Used:" + "/t/t" + tempNumRings;<br />
			WeaveLine3 = "Weave Name:" + "/t/t/t" + "!" + tempWeaveName;<br />
			WeaveLine4 = "Example Ring Sizes:" + "/t/t" + "!" + tempExampleSizes;<br />
			Buffer = Buffer + WeaveLine1 + "/n" + WeaveLine2 + "/n" + WeaveLine3 + "/n" + WeaveLine4;<br />
			if(currPtr->link != NULL)<br />
				Buffer = Buffer + "/n/n";<br />
			currPtr = currPtr->link; //advance to next node in list<br />
		}<br />
	}<br />
	else<br />
		Buffer = "";<br />
	WriteSucceeded = SaveListToFile(FileName, Buffer); //send the buffer to be saved<br />
	if(WriteSucceeded)<br />
		cout<<"SUCCESS!"<<endl;<br />
	else<br />
		cout<<"F***! Unable to write to file."<<endl;

I'm doing this totally on my own without an instructor to pester with questions, so any help would be appreciated. I can post the rest of the file if anyone wants, but it's kind of long.

-- modified at 15:53 Friday 19th May, 2006
AnswerRe: Problem with Linked List Pin
led mike19-May-06 11:22
led mike19-May-06 11:22 
AnswerRe: Problem with Linked List Pin
_AnsHUMAN_ 19-May-06 18:33
_AnsHUMAN_ 19-May-06 18:33 
AnswerRe: Problem with Linked List Pin
Laxman Auti19-May-06 19:45
Laxman Auti19-May-06 19:45 
Questiontabstop Pin
sandem19-May-06 9:44
sandem19-May-06 9:44 
AnswerRe: tabstop Pin
Steve Echols19-May-06 19:34
Steve Echols19-May-06 19:34 
GeneralRe: tabstop Pin
sandem22-May-06 3:45
sandem22-May-06 3:45 
QuestionCView doesn't respond to PostMessage Pin
masnu19-May-06 9:26
masnu19-May-06 9:26 
AnswerRe: CView doesn't respond to PostMessage Pin
Mauro Leggieri19-May-06 9:41
Mauro Leggieri19-May-06 9:41 
AnswerRe: CView doesn't respond to PostMessage Pin
led mike19-May-06 11:17
led mike19-May-06 11:17 
AnswerRe: CView doesn't respond to PostMessage Pin
Nibu babu thomas19-May-06 18:47
Nibu babu thomas19-May-06 18:47 
QuestionIterators in forms Pin
mgodsey19-May-06 8:15
mgodsey19-May-06 8:15 
AnswerRe: Iterators in forms Pin
led mike19-May-06 8:56
led mike19-May-06 8:56 
GeneralRe: Iterators in forms Pin
mgodsey19-May-06 10:26
mgodsey19-May-06 10:26 
Questionget HiByte [modifed] Pin
big_denny_20019-May-06 7:59
big_denny_20019-May-06 7:59 
Questionget idd of object [modifed] Pin
big_denny_20019-May-06 6:51
big_denny_20019-May-06 6:51 
AnswerRe: get idd of object Pin
Cedric Moonen19-May-06 7:17
Cedric Moonen19-May-06 7:17 
AnswerRe: get idd of object Pin
David Crow19-May-06 7:20
David Crow19-May-06 7:20 

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.