expected primary-expression & obtaining substrings

Hopefully someone can show me a ‘best way’ to do substrings… my plans are to simply return a pointer to a new string that I will assign CurrentText to…

But my real problem is that I am getting this pesky “error: expected primary-expression before ‘char’” and it is pointing at the ‘char substr(’ on the bottom…

here’s the code…

#include <Mlcd.h>

char ScrollText[255] = "\0";
char CurrentText[255] = "\0";
char tmpStr[255] = "\0";
int CurPos = 0;
int CurDir = 1;
Mlcd mLCD(19200);

char substr(*char, int, int);

void setup() 
{ 
  mLCD.start();
  mLCD.clrScrn();
  strcat(ScrollText, "Bluegrass Digital Inc.");
} 

void loop() 
{
  while (1)
  {
    if (CurDir == 1)
    {
      strncat(CurrentText, &ScrollText[CurPos], 1);
    }
    if (strlen(CurrentText) > 16)
    {
      //strncpy(CurrentText, *(&CurrentText+1), 16);
    }
    if (CurPos < strlen(ScrollText)) {CurPos += CurDir;} else {CurDir = -1;}
    mLCD.setCursor(16 - strlen(CurrentText), 1);
    mLCD.sendText(CurrentText);
    delay(200);
  }
}

char substr(*char srcStr, int start, int length)
{
}

Not sure about a 'best way' but assuming you want substr to create a new string, it could be done as follows (note the * follows the char):

char*  substr(char* srcStr, int start, int length)
{
 // You then need to allocate memory for the new string, which you can do using malloc:
  char* newString = (char*)malloc(length+1);
  if(newString) {  // check that malloc was able to allocate the memory
      strncpy(newString,&srcStr[start], length); // copy the source string
      newString[length] = '\0';  // make sure there is a terminating 0    
  }
  return newString;  
}

don't forget that you should free the string when you are done with it if you want to reuse the memory

Thanks ! I really need to read a good book on C I guess... trying to do this 'learning by example' is not working as well as most other languages.... mostly due to the unobvious use of pointers ;D