strlen-c/cpp/_rvmain.cpp

30 lines
337 B
C++

#include <stdint.h>
char * ptr1 = "Dominik P";
int strlen(char *s)
{
char *p = s;
while (*p != '\0')
p++;
return p - s;
}
void strcpy(char *s, char *t)
{
while (*s++ = *t++);
}
int main() {
char tab [20];
strcpy( tab, ptr1);
uint8_t wynik =0;
wynik = strlen (tab);
asm("nop");
}