Well,
If you are learning C and you are typing:
char* foo, bar;
You are makeing a fundamental mistake, because
bar is now type char and foo is type pointer to char.
However if you look at this line:
parse(char *cSrc, char *cRet, int nSubstr, char* cDelimeter)
You see that the first two...
PerFnurt,
I looked in K & R Vol2, and it did not cover this subject. Thank you for clearing that up. I ran some tests, and found no functional differences.
>No man am not talking about two spaces !
>You wrote in your function declaration:
>char* cDelimeter
while semantically you may be right and this may mean pointer to char.
>Try the following: char *cDelimeter
and this may be pointer to an array of characters
if I increment *cDelimeter++ in...
>No you can't - if p is NULL, there is no strlen(p)
Sorry I meant if ep==NULL then but p!=NULL then that could be the last field.
>size_t strspn(const char *s, const char *accept);
>size_t strcspn(const char *s, const char *reject);
I will look at those now.
>But watch out - they return...
>Seems OK, except I would use strncpy instead of a while >loop
Ok, I understand, but I like the while loop. Cant think of a reason not to do it.
>This needs to be guarded against p being NULL as well
I think if p == NULL but ep != NULL then ep could be set to p+strlen(p). That way the last...
ty very much salem, good points.
here is a new function based on a previous post of yours i believe. I added a little that I think works great.
ahoodin
void find_field ( char *line, char* cRet, char delim, int count ) {
char *p = line;
char *ep;
int i,imax;
for ( i = 0 ...
I dont think that is the access violation.
equivalently:
This should be: char *cDelimeter
this should really be:
This should be: char *cDelimeter
Two spaces after any colon, Thanks.
Seriously lets not fight over it, it's pointless and borin.
ahoodin
I use this function to parse delimeted data. When it is used in a loop sometimes I wonder about it. Normally solid dialogs will blink a bit when using data returned from it. Can anyone see anything?
TIA,
ahoodin
int parse(char *cSrc, char *cRet, int nSubstr, char* cDelimeter){//can use...
Anybody know of a good communications program that also happens to be freeware? Haven't had to use serial communications for a while and probably should have saved some software. I will be doing direct communications to COM1, with both Windows 98 and Windows 2000 and maybe XP in the near...
The working dirctory is unimportant as the dll is explicitly linked in...this means no .lib required nor working directory. With the remote debugger I just dont get source on stepping in.
ahoodin
I am trying to remote debug my app, I can't get
debugging information on a DLL that I have explicitly
linked to the application. I need to step into that code!
I get these errors:
Loaded symbols for 'my.dll' Preloaded symbols may not match 'h:\GetBlock\Debug\GetBlock.exe'.
LDR: Automatic...
Well,
you could just do an FTP. Look up FTP in the help files in MSDN, before you ask how.
Do you want to rewrite the code to send a binary file with your own proprietary method?
ahoodin
I have an NT4 Box that is running an application suite that communicates over a bunch of memory mapped files. These files however have special
permissions set:
Administrators (Special Access DPOQM)
System (Special Access DPOQM)
The writers of this application suite took special note...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.