Original Post
Header
#ifndef _Main_h #define _Main_h int StrLen(char*); void SetString(char*, char*); #endifSource
#include <iostream>
#include <cstdlib>
#include "Main.h"
using std::cout;
using std::cin;
using std::endl;
int main(void)
{
char strBuffer[50];
char strMessage[50] = "Hello World!";
SetString( strBuffer, strMessage );
cout << strBuffer << endl;
cin.get();
return EXIT_SUCCESS;
}
int StrLen( char * paramString )
{
int iCount = 0;
while( paramString[iCount] != ''\0'' )
{
iCount++;
}
return iCount;
}
void SetString( char * strEmpty, char * strSource )
{
for( int i = 0; i < StrLen(strSource); i++ )
{
strEmpty[i] = strSource[i];
}
}
No compiler errors but when it actual outputs the string........it also outputs *excessive* or unneeded/unwanted/unknown characters. If there anyway to cut the excessive off?
--------
"Do you believe in Ghost?"