Hi,
I've got a code that needs to return the substr. For this I have the following code
Code:
-----------------------------------------------------------------------
#include <string>
#include <stdio.h>
#include <iostream.h>
#include <afx.h>
void sub_str(char *pntr)
{
CString name = pntr;
printf("%s\n",name.Mid(2,3));
};
void main()
{
char temp[20];
printf("Enter value :");
scanf("%s",temp);
sub_str(temp);
}
----------------------------------------------------------------------------------
How do I return the substr value back to the sub_str() function?
I've tried a shot using return, but it doesn't work..
Thanks,
John![]()



LinkBack URL
About LinkBacks




)