Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
strend
#include <stdio.h> //namespace std; //int strcmp(char *s, char *t){ int i=0;while((*s++==*t++)&&(*s!='\0')&&(*t!='\0')) return 0;} //int strcmp(char *s, char *t){int i; for(i=0;s[i]==t[i];i++)if(s[i]=='\0')return 0; return s[i]-t[i]; } int strcmp(char *s, char *t){ for(;*s==*t;s++,t++)if(*s=='\0')return 0; return *s - *t; } void strcat(char *s, char *t) {char *p=t;int i=10; while(*s!='\0')s++; printf("%d",s-p); i=s; while((s[i++] = p[i++])!='\0' );//{*s = *p;s++;} //for(int i=0;i<strlen(s);i++) printf("%c \n",*s); } //printf("%d \n",s); int strlen(char *s) {int i=0; while(*s!='\0'){i++;s++;} return i; } int strend(char *s, char *t) { int ls=strlen(s); int lt=strlen(t); printf("%d \n",ls); printf("%d",lt); s=s+ls-lt;printf("%c",*s); for(;*s==*t;s++,t++)if(*s!='\0')return 1; return 0; } int main() { int *ip,a=3,b[10]={1,2,3,4,5,6}; char *c=(char *)malloc(30); printf("%x\n", c); c[0] = 'f'; c[1]='\0'; puts(c); c="sirdecara"; printf("%x\n", c); char *s="lbirdecaph"; // c1 // cout<< strcmp(c,c1); //printf("%d \n",strcmp(c,c1)); // strcat(&c,&s); for(int i=1;i<strlen(c);i++) printf("%c \n",c[i]); char c1[]="adcdefghtkbjvilugrvlb"; char c2[]="ghtkbjvirvrlugrvlb"; printf("\n%d ",strend(c1,c2));; }
run
|
edit
|
history
|
help
0
Factorial Descompuesto en Potencias de Numeros Primos
Coba
Practice
Project 3 Part 1 v1.5
bitwise operations
MEMORIA DINAMICA FUNCIONA
Atleti
this
B_141202_CADENA_NUMERO
data types and printf