[ create a new paste ] login | about

Link: http://codepad.org/5Pp1OHL4    [ raw code | output | fork ]

C, pasted on Nov 24:
#include<stdio.h>
#include<conio.h>
#include<string.h>

/*

*/
int StringLength(char s[])
{
	int i = 0; 
	while(s[i] != '\0')
	{
		i++;
	}
	return i;
}

int STRLEN(char *s)
{
	int dem = 0;
	while(s[dem] != '\0')
	{
		dem++;
	}
	return dem;	
}
int main()
{
	char s[] = "Hello World";
	int length = StringLength(s);
	printf("\nDo dai cua chuoi s la: %d", length);

	int len = STRLEN(s);
	printf("\nDo dai cua chuoi s la: %d", len);

	getch();
	return 0;
}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: