Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
String manipulation
#include <stdio.h> #define SIZE 30 int main(void) { // my array for the string char myString[SIZE]; int stringLength = 0; int i = 0; printf("Example program for some string manipulations.\n"); // First read in an input string if (fgets(myString, SIZE, stdin)) { //give it an array of characters, maximum size it can accept, where you want to get it from while (myString[i] != 0) { stringLength++; i++; } printf("Length of %s is %d", myString, stringLength); } else { printf("Error reading in the string!\n"); } return 0; }
run
|
edit
|
history
|
help
0
example of scanf and basic integer manipulation
ele709 3.5 finished
romitk
a.c
150116_PrimoFactorial
B_141111_Divisores
Project 3 Part 1 v1.5
Assignment 7
PRÁCTICA DE QUICKSORT
Square pyramid