code vault - string_posWhat links here?

Code

//##############################################################################
// Return the position of sub in string.
// Return the length of string if sub not found.
//##############################################################################


int pos(char *sub, char *string) { int i, j;

for(i = 0; i < strlen(string); i++) { for (j = 0; j < strlen(sub); j++) { if (string[i+j] != sub[j]) break; } if (j == strlen(sub)) return(i); } return(strlen(string)); }

Alternate version

//##############################################################################
// Return the position of sub in string.
// Return the -1 if sub not found.
//##############################################################################


int pos(char *sub, char *string) { int i, j;

for(i = 0; i < strlen(string); i++) { for (j = 0; j < strlen(sub); j++) { if (string[i+j] != sub[j]) break; } if (j == strlen(sub)) return(i); } return(-1); }
code vault - string_pos
microprocessors - microchip 16F874A, 16F877A - pins
embedded systems - bacnet - Context Tag
programming - javascript - methods - unshift
embedded systems - bacnet - BVLC
programming - sqlite3 - c interface - sqlite3_prepare()
programming - javascript - methods - push
programming - C - structs
test page 005 - escaping of ampersands
programming - DDE - WinWord DDE Server
programming:windows:WM_CREATE
AutoCAD - Dialog Control Language (DCL) - button
code vault - strtail
filename:code vault - string_pos
filename:code%20vault%20%2D%20string_pos
last edit:March 26 2009 19:52:24 (5532 days ago)
ct = 1716082335.000000 = May 18 2024 21:32:15
ft = 1238111544.000000 = March 26 2009 19:52:24
dt = 477970791.000000