int main(int ac, char **av) { rb_t buffer; rb_reset(&buffer); //d_s(&buffer, "T40484269E72E;T40484369001F;"); d_s(&buffer, "T40484269E743001F;T404847690118;"); FHT_compress(&buffer); p(&buffer); }
int main() { size_t nm = 2; regmatch_t pm[ nm ]; char * s; printf( "Enter string: " ); s = d_s( s ); char * re; printf( "Enter regex with parenthesized subexpression: " ); re = d_s( re ); if( rematch( s, re, nm, pm ) ) printf( "Subexpression = [%s]\n", substring( s, pm[ 1 ].rm_so, pm[ 1 ].rm_eo - 1 ) ); else printf( "Couldn't extract substring.\n" ); free( s ); return 0; }
int main() { char * s; printf( "String value before d_s() = [%s]\n", s ); printf( "Enter string value: " ); s = d_s( s ); printf( "String value after d_s() = [%s]\n", s ); free( s ); return 0; }
int main() { char * s; double x; double y = 1234.5678; printf( "Enter a string that's in the same format of a number (e.g. '1234.5678'): " ); s = d_s( s ); x = str2num( s ); //printf( "[%s] converts to [%f]\n", s, x ); printf( "%.4lf - %s = [%.4lf]\n", y, s, y - x ); free( s ); return 0; }
void draw_ship(t_img *img) { const double save_x = img->plan.x_a; const double save_y = img->plan.y_a; img->y = 0; while (img->y < HEIGHT) { img->plan.x_a = save_x; img->x = 0; while (img->x < WIDTH) { d_s(img); ++img->x; img->plan.x_a += img->plan.step_x; } ++img->y; img->plan.y_a += img->plan.step_y; } img->plan.x_a = save_x; img->plan.y_a = save_y; }