Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Punteros: strlen
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Title of this code //clang 3.6.0 #include <stdio.h> int strlen(char *s) { int n; for (n=0; *s!='\0'; s++) n++; return n; } int strlen2(char *s) { char *p=s; while(*p!='\0') p++; return p-s; } int main(void) { int i; char cadena[20]="mi mama me mima"; // ={'m', 'i', ....., '\0'}; printf("cadena=%s longitud=%d longitud2=%d", cadena, strlen(cadena), strlen2(cadena)); /* for (i=0; i<20; i++) printf("%c", cadena[i]); */ return 0; }
clang
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 5 Mb, absolute service time: 0.35 sec
fork mode
|
history
|
discussion
cadena=mi mama me mima longitud=15 longitud2=15