Home / guide / beyond_cs302 / string_ex1.c
Directory Listing
calloc.c
hello_world.c
makefile
malloc_free.c
new_delete.cpp
realloc.c
string_ex1.c
string_ex2.c
struct_ex1.c
struct_ex1.cpp
struct_ex2.c
struct_func_ex.c
struct_func_ex.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <string.h>

int main() {
	char *str = "Hello World!";
	printf("%s\n", str);

	//Get string length and print it
	size_t str_size = strlen(str);
	printf("The string's size is: %d\n", str_size);

	return 0;
}