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

C / C++ / MFC

 
GeneralRe: PadRight Pin
Mark Salsbery28-Oct-07 7:18
Mark Salsbery28-Oct-07 7:18 
GeneralRe: PadRight Pin
teejayem28-Oct-07 7:44
teejayem28-Oct-07 7:44 
GeneralRe: PadRight Pin
Mark Salsbery28-Oct-07 7:48
Mark Salsbery28-Oct-07 7:48 
GeneralRe: PadRight Pin
teejayem28-Oct-07 9:46
teejayem28-Oct-07 9:46 
GeneralRe: PadRight Pin
Mattias G28-Oct-07 10:37
Mattias G28-Oct-07 10:37 
GeneralRe: PadRight Pin
teejayem28-Oct-07 12:51
teejayem28-Oct-07 12:51 
GeneralRe: PadRight Pin
Mark Salsbery29-Oct-07 5:50
Mark Salsbery29-Oct-07 5:50 
GeneralRe: PadRight Pin
teejayem29-Oct-07 7:53
teejayem29-Oct-07 7:53 
Hey Mark, Thanks again for the help. Below is what i have for the padright function (tested it and it seems to work). It might not be the most effecient thing in the world but i'm just a little C# programmer trying to harness the power of C++. I've only been working with Unmanaged C for a week now

 char* StringHelper::PadRight(int nCharsToPad, char *strToPad, char chPadValue) {

	char* strPadResult;
	int nCurLen = strlen(strToPad);
	strPadResult = (char*)malloc(sizeof(nCharsToPad));

	for (int i = 0; i <= nCharsToPad - nCurLen;i++) {
		strPadResult[i] = chPadValue;
	}

	int nIndex = 0;
	for (int j = nCharsToPad - nCurLen; j < nCharsToPad; j++) {
		strPadResult[j] = strToPad[nIndex];
		nIndex++;
	}

	strPadResult[nCharsToPad] = '\0';
	return strPadResult;
}


Thanks again!

Don't be overcome by evil, but overcome evil with good

GeneralRe: PadRight Pin
Mark Salsbery29-Oct-07 8:07
Mark Salsbery29-Oct-07 8:07 
GeneralRe: PadRight Pin
teejayem29-Oct-07 8:17
teejayem29-Oct-07 8:17 
GeneralRe: PadRight Pin
Mark Salsbery29-Oct-07 8:23
Mark Salsbery29-Oct-07 8:23 
GeneralRe: PadRight Pin
teejayem29-Oct-07 8:34
teejayem29-Oct-07 8:34 
AnswerRe: PadRight Pin
David Crow29-Oct-07 4:13
David Crow29-Oct-07 4:13 
QuestionIs it possible to have the .dll outside the system32? Pin
has98127-Oct-07 11:24
has98127-Oct-07 11:24 
AnswerRe: Is it possible to have the .dll outside the system32? Pin
Mark Salsbery27-Oct-07 12:14
Mark Salsbery27-Oct-07 12:14 
AnswerRe: Is it possible to have the .dll outside the system32? Pin
Nelek28-Oct-07 23:33
protectorNelek28-Oct-07 23:33 
GeneralRe: Is it possible to have the .dll outside the system32? Pin
has98129-Oct-07 1:43
has98129-Oct-07 1:43 
GeneralRe: Is it possible to have the .dll outside the system32? Pin
Nelek29-Oct-07 21:16
protectorNelek29-Oct-07 21:16 
AnswerRe: Is it possible to have the .dll outside the system32? Pin
has98130-Oct-07 6:50
has98130-Oct-07 6:50 
QuestionMaximize + multiple monitors? Pin
Dominik Reichl27-Oct-07 8:59
Dominik Reichl27-Oct-07 8:59 
AnswerRe: Maximize + multiple monitors? Pin
Mattias G27-Oct-07 12:09
Mattias G27-Oct-07 12:09 
QuestionSecure Interprocess Communication Pin
Richard Andrew x6427-Oct-07 7:23
professionalRichard Andrew x6427-Oct-07 7:23 
AnswerRe: Secure Interprocess Communication Pin
Mark Salsbery27-Oct-07 7:54
Mark Salsbery27-Oct-07 7:54 
GeneralRe: Secure Interprocess Communication Pin
Richard Andrew x6427-Oct-07 8:03
professionalRichard Andrew x6427-Oct-07 8:03 
QuestionRequest for Integer DCT Source code Pin
Sivadanams27-Oct-07 3:23
Sivadanams27-Oct-07 3:23 

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.