Click here to Skip to main content
15,885,920 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GetModuleFileName and case sensitivity Pin
vikramlinux24-Jul-13 1:23
vikramlinux24-Jul-13 1:23 
SuggestionRe: GetModuleFileName and case sensitivity Pin
Richard MacCutchan24-Jul-13 4:56
mveRichard MacCutchan24-Jul-13 4:56 
GeneralRe: GetModuleFileName and case sensitivity Pin
vikramlinux24-Jul-13 16:56
vikramlinux24-Jul-13 16:56 
GeneralRe: GetModuleFileName and case sensitivity Pin
Richard MacCutchan24-Jul-13 21:13
mveRichard MacCutchan24-Jul-13 21:13 
Questioncalculated as 0 and 1 in a matrix Pin
yahya7723-Jul-13 8:06
yahya7723-Jul-13 8:06 
QuestionRe: calculated as 0 and 1 in a matrix Pin
David Crow23-Jul-13 9:08
David Crow23-Jul-13 9:08 
AnswerRe: calculated as 0 and 1 in a matrix Pin
Alan Balkany25-Jul-13 4:23
Alan Balkany25-Jul-13 4:23 
GeneralRe: calculated as 0 and 1 in a matrix Pin
yahya7725-Jul-13 5:50
yahya7725-Jul-13 5:50 
yes indeed. I just found the solution as follows:
C
int* printArray(int *input,int max)
{
	int *res;res=(int*)malloc(max*sizeof(int));for(int i = 0; i<max; i++) {res[i]=0;}
 	int current_kind = -1;
 	int count = 0;int cp=0;
	for(int i = 0; i<max; ++i) {
		 
 		if (current_kind!=input[i]) 
		{  
			if (count!=0)  res[ cp]=count; 
			current_kind = input[i] ;
			count = 1;cp++; 
		} else { count++; }
		 
		}
	res[cp]=count; 
return res;	
}


after, just use this function to calculate the matrix row by row.

thanks for suggestion !
QuestionSerial Port OK in class constructor but not outside... Pin
Mike Grove23-Jul-13 5:49
Mike Grove23-Jul-13 5:49 
AnswerRe: Serial Port OK in class constructor but not outside... Pin
Jochen Arndt23-Jul-13 6:23
professionalJochen Arndt23-Jul-13 6:23 
GeneralRe: Serial Port OK in class constructor but not outside... Pin
Mike Grove23-Jul-13 22:11
Mike Grove23-Jul-13 22:11 
AnswerRe: Serial Port OK in class constructor but not outside... Pin
etkid8423-Jul-13 8:53
etkid8423-Jul-13 8:53 
GeneralRe: Serial Port OK in class constructor but not outside... Pin
Mike Grove23-Jul-13 22:13
Mike Grove23-Jul-13 22:13 
AnswerRe: Serial Port OK in class constructor but not outside... Pin
pasztorpisti23-Jul-13 9:16
pasztorpisti23-Jul-13 9:16 
GeneralRe: Serial Port OK in class constructor but not outside... Pin
Richard Andrew x6423-Jul-13 13:31
professionalRichard Andrew x6423-Jul-13 13:31 
GeneralRe: Serial Port OK in class constructor but not outside... Pin
pasztorpisti24-Jul-13 1:03
pasztorpisti24-Jul-13 1:03 
GeneralRe: Serial Port OK in class constructor but not outside... Pin
Richard Andrew x6424-Jul-13 14:03
professionalRichard Andrew x6424-Jul-13 14:03 
GeneralRe: Serial Port OK in class constructor but not outside... Pin
pasztorpisti24-Jul-13 14:17
pasztorpisti24-Jul-13 14:17 
QuestionInitilazation error in MFC C++ App Pin
ForNow23-Jul-13 5:16
ForNow23-Jul-13 5:16 
SuggestionRe: Initilazation error in MFC C++ App Pin
Richard MacCutchan23-Jul-13 5:31
mveRichard MacCutchan23-Jul-13 5:31 
GeneralRe: Initilazation error in MFC C++ App Pin
ForNow23-Jul-13 6:30
ForNow23-Jul-13 6:30 
GeneralRe: Initilazation error in MFC C++ App Pin
Richard MacCutchan23-Jul-13 6:48
mveRichard MacCutchan23-Jul-13 6:48 
GeneralRe: Initilazation error in MFC C++ App Pin
ForNow23-Jul-13 8:22
ForNow23-Jul-13 8:22 
GeneralRe: Initilazation error in MFC C++ App Pin
David Crow23-Jul-13 9:11
David Crow23-Jul-13 9:11 
GeneralRe: Initilazation error in MFC C++ App Pin
ForNow26-Jul-13 5:16
ForNow26-Jul-13 5:16 

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.