Click here to Skip to main content
15,891,597 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error : 'strcpy_s' : none of the 2 overloads could convert all the argument types. Pin
«_Superman_»15-Apr-11 21:46
professional«_Superman_»15-Apr-11 21:46 
AnswerRe: Error : 'strcpy_s' : none of the 2 overloads could convert all the argument types. Pin
David Crow16-Apr-11 3:59
David Crow16-Apr-11 3:59 
AnswerRe: Error : 'strcpy_s' : none of the 2 overloads could convert all the argument types. Pin
linc_lee16-Apr-11 4:15
linc_lee16-Apr-11 4:15 
GeneralRe: Error : 'strcpy_s' : none of the 2 overloads could convert all the argument types. Pin
David Crow16-Apr-11 10:32
David Crow16-Apr-11 10:32 
AnswerRe: Error : 'strcpy_s' : none of the 2 overloads could convert all the argument types. Pin
refla17-Apr-11 1:41
refla17-Apr-11 1:41 
QuestionVisual Studio 4.1 Pin
venkat11615-Apr-11 19:15
venkat11615-Apr-11 19:15 
AnswerRe: Visual Studio 4.1 Pin
«_Superman_»15-Apr-11 21:17
professional«_Superman_»15-Apr-11 21:17 
QuestionAlgorithm [modified] Pin
Cyclone_S15-Apr-11 13:40
Cyclone_S15-Apr-11 13:40 
Hi, I am coding an algorithm that searches for a box on the screen. So far I got the snake to find the food which works great except that for example. If the snake is moving right it will sometimes move left and move ontop of it's self. I've spent awhile trying to figure it out on my own with no success. I think it has to do with the two blocks of if statements but I'm not sure. Maybe they need to be combined somehow? This is the last thing I need to figure out and my program is finished. Thanks in advance.

I tried.

if(direction_comp!=1){direction_comp=-1;} else {direction_comp=2;}  // If snake is not moving left then move it right else move it up to avoid it from moving on top of it's self.


direction_comp of 1 = left;
direction_comp of -1 = right;
direction_comp of 2 = up;
direction_comp of -2 = down;


void comp_direction()
			{


				if(segments_comp[head_comp]->panel->Left <= Food->Left)
				{	
					if(segments_comp[head_comp]->panel->Top >= Food->Top){direction_comp =2;}
					else{direction_comp=-1;}
				}
				else if(segments_comp[head_comp]->panel->Left >= Food->Left)
				{	
					if(segments_comp[head_comp]->panel->Top >= Food->Top){direction_comp =2;}
					else{direction_comp=1;}

				}
				if(segments_comp[head_comp]->panel->Top <= Food->Top)
				{
					if(segments_comp[head_comp]->panel->Left <= Food->Left){direction_comp =-1;}
					else{direction_comp=-2;}
					
				}
				else if(segments_comp[head_comp]->panel->Top >= Food->Top)
				{
					if(segments_comp[head_comp]->panel->Left >= Food->Left){direction_comp =1;}
					else{direction_comp=2;}
				}

			}


modified on Friday, April 15, 2011 7:47 PM

AnswerRe: Algorithm Pin
Hans Dietrich15-Apr-11 18:07
mentorHans Dietrich15-Apr-11 18:07 
QuestionVC, Linker Tools Warning LNK4086 Pin
refla15-Apr-11 13:22
refla15-Apr-11 13:22 
AnswerRe: VC, Linker Tools Warning LNK4086 Pin
Hans Dietrich15-Apr-11 18:55
mentorHans Dietrich15-Apr-11 18:55 
GeneralRe: VC, Linker Tools Warning LNK4086 Pin
refla17-Apr-11 1:31
refla17-Apr-11 1:31 
AnswerRe: VC, Linker Tools Warning LNK4086 Pin
Hans Dietrich17-Apr-11 1:35
mentorHans Dietrich17-Apr-11 1:35 
GeneralRe: VC, Linker Tools Warning LNK4086 Pin
refla17-Apr-11 2:09
refla17-Apr-11 2:09 
AnswerRe: VC, Linker Tools Warning LNK4086 Pin
Hans Dietrich17-Apr-11 2:30
mentorHans Dietrich17-Apr-11 2:30 
GeneralRe: VC, Linker Tools Warning LNK4086 Pin
refla18-Apr-11 10:44
refla18-Apr-11 10:44 
QuestionBuild Error - Creating a DirectSound secondary buffer [modified] Pin
Paul Hasler15-Apr-11 4:44
Paul Hasler15-Apr-11 4:44 
AnswerRe: Build Error - Creating a DirectSound secondary buffer Pin
Richard MacCutchan15-Apr-11 5:06
mveRichard MacCutchan15-Apr-11 5:06 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Paul Hasler15-Apr-11 5:19
Paul Hasler15-Apr-11 5:19 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Richard MacCutchan15-Apr-11 6:01
mveRichard MacCutchan15-Apr-11 6:01 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Paul Hasler15-Apr-11 6:48
Paul Hasler15-Apr-11 6:48 
GeneralRe: Build Error - Creating a DirectSound secondary buffer Pin
Richard MacCutchan15-Apr-11 7:26
mveRichard MacCutchan15-Apr-11 7:26 
QuestionMultiple selection in CListCtrl?? Pin
Arrin15-Apr-11 0:29
Arrin15-Apr-11 0:29 
AnswerRe: Multiple selection in CListCtrl?? Pin
Hans Dietrich15-Apr-11 5:13
mentorHans Dietrich15-Apr-11 5:13 
GeneralRe: Multiple selection in CListCtrl?? Pin
Arrin6-May-11 0:35
Arrin6-May-11 0:35 

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.