Click here to Skip to main content
15,916,692 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WebLogic & ISS Server Pin
Richard MacCutchan7-Dec-11 23:19
mveRichard MacCutchan7-Dec-11 23:19 
QuestionWS_TABSTOP Pin
jkirkerx7-Dec-11 8:51
professionaljkirkerx7-Dec-11 8:51 
AnswerRe: WS_TABSTOP Pin
David Crow7-Dec-11 9:34
David Crow7-Dec-11 9:34 
GeneralRe: WS_TABSTOP Pin
jkirkerx7-Dec-11 10:56
professionaljkirkerx7-Dec-11 10:56 
GeneralRe: WS_TABSTOP Pin
jkirkerx8-Dec-11 8:49
professionaljkirkerx8-Dec-11 8:49 
AnswerRe: WS_TABSTOP Pin
Stephen Hewitt8-Dec-11 2:16
Stephen Hewitt8-Dec-11 2:16 
GeneralRe: WS_TABSTOP Pin
jkirkerx8-Dec-11 6:14
professionaljkirkerx8-Dec-11 6:14 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 15:02
Stephen Hewitt9-Dec-11 15:02 
GeneralRe: WS_TABSTOP Pin
jkirkerx9-Dec-11 15:23
professionaljkirkerx9-Dec-11 15:23 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 15:39
Stephen Hewitt9-Dec-11 15:39 
GeneralRe: WS_TABSTOP Pin
jkirkerx9-Dec-11 16:34
professionaljkirkerx9-Dec-11 16:34 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 19:42
Stephen Hewitt9-Dec-11 19:42 
GeneralRe: WS_TABSTOP Pin
jkirkerx9-Dec-11 20:18
professionaljkirkerx9-Dec-11 20:18 
GeneralRe: WS_TABSTOP Pin
Stephen Hewitt9-Dec-11 21:22
Stephen Hewitt9-Dec-11 21:22 
AnswerIt works, now but how to detect shift tab << Pin
jkirkerx8-Dec-11 12:40
professionaljkirkerx8-Dec-11 12:40 
GeneralRe: It works, now but how to detect shift tab << Pin
Graham Breach8-Dec-11 13:06
Graham Breach8-Dec-11 13:06 
GeneralRoom for improvement let me know. Pin
jkirkerx8-Dec-11 13:16
professionaljkirkerx8-Dec-11 13:16 
QuestionParsing in C Pin
Software20077-Dec-11 6:55
Software20077-Dec-11 6:55 
AnswerRe: Parsing in C Pin
Albert Holguin7-Dec-11 7:23
professionalAlbert Holguin7-Dec-11 7:23 
AnswerRe: Parsing in C Pin
Chris Losinger7-Dec-11 8:10
professionalChris Losinger7-Dec-11 8:10 
GeneralRe: Parsing in C Pin
Software20077-Dec-11 9:54
Software20077-Dec-11 9:54 
QuestionRe: Parsing in C Pin
David Crow7-Dec-11 9:27
David Crow7-Dec-11 9:27 
AnswerRe: Parsing in C Pin
Software200710-Dec-11 13:28
Software200710-Dec-11 13:28 
AnswerRe: Parsing in C Pin
Software200712-Dec-11 5:52
Software200712-Dec-11 5:52 
I have one more question C- related:
C++
char *getLine(char *p, char *out)
{
   int Dees = 0;
   char *px = p;
   p++;   //advance to where we think there is '('
 
   if (*p!='(') return NULL; // error
 
   int paren_count = 1;
 
   while (*px)
   {
                   if(*px=='d')
                   {
                                   Dees++;
                                   if(Dees >1 && *(px+1)=='(') //Done at 2nd 'd'
                                      break;
                   }
 
       *out = *px; // copy
       out++; px++; // next
   }
   return px;
}

//main program
  char *px="d(text)n(0)l(1)d(text2)n(1)l(2)...";
  char line[8192];
  char *py = getLine(px,line);


In the main program, after calling the function getLine(), I do get line correctly as in "d(text)n(0)l(1)" but filled with garbage after that as its trying to fill out 8192 characters. How do I make it not fill the rest of the unused space. Note, I don't know the size of "line" as it varies, but I need it big enough. I know strcpy could be useful here somewhere, just can't get it to work.

I also tried in getLine() the following:
char field[4095];
 strcpy(field,out);

But nothing gets copied, out shows null in the debugger.


Thanks

modified 12-Dec-11 12:00pm.

AnswerRe: Parsing in C Pin
David Crow12-Dec-11 7:15
David Crow12-Dec-11 7:15 

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.