get last char string c

char fruit[5] = "apple";
printf("Last character : %c", fruit[strlen(fruit)-1]);

4
6
JIlly 110 points

                                    The last character of string in C is '\0'

4 (6 Votes)
0
3
2
James King 95 points

                                    strlen(str);

3 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
c last occurrence of string find last in string C function that returns last word of a string in c how to get last character of a string in c find last instance of char in string C c get last word in string dilinay print string without last char in c cut the last char of a string in c last word in a string representation in c get last 4 chars of a string c get last character in string c without pointers get last character in string c c last word string c find last word in string c find last instance of character in string c find last occurrence of string in string c find last occurrence of character in string how to find the index of the last value in a string in c get the last character of a string in c how to check last character of string in c langauge read last n characters of a string in c c get last word in string c get the last 5 character of a string objective c last character in string how to get last alphabet of a string in c how to find last character of a string in c c find last char in string is last character of a string \0 in c put the last word of a string c C check last element of string function how to last character in c how to check last character of string c get string till last character c c string last character not printing string last position c get last char in string + c c get last index of char find the last index of a string in a string c get to the last element of string in c how to find last occurrence of a character in a string in c find last character in c array get the last char of an array c how to get the last 20% of a string in c get the last character in a string in c c last char of string c get last 4 characters of string get last 4 characters of string in c how to get the last char in a string in C get last char string c how to check the last char in a string c c last char in string how to last index of a string in c find last occurrence of character in string c how to get the last item in string c getting last character of string c how to get last digit of string in c how to check for last char in c find last appearnce of char in string c ncurses last character of string c how to find last index of character in a string in C how to get the last character in a string c taking the last letter in a string c c check what last letter of string is last letter of string c get the last word in a string C how to check last character of string in c last 3 letter of a string in c print last character of string in c how to get the last character of a string c how to get last char of a string C get last character of string c last character in string c last character of a string in c how to get last char of string in c what is the last character of a string in c c get last char string last character in c last character of string c last character of string in c c get last character of string get last letter of string c how to check where the last char is in a string c
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source