hai..
how to find numbers in a char array like
Ex: [a,1,b,2,c,3] = [a,b,c,1,2,3]
Ex2: [a1,b2,c3] = [a,b,c,1,2,3]
thanks..
hai..
how to find numbers in a char array like
Ex: [a,1,b,2,c,3] = [a,b,c,1,2,3]
Ex2: [a1,b2,c3] = [a,b,c,1,2,3]
thanks..
Post something in an actual char array.
Have different answers.Code:char x[] = "abc123"; char y[] = " [a,b,c,1,2,3]";
You need to show us exactly how your notation maps to actual stored characters in a program.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
a char array contain ['a','1','b','2','c','3','d'] means output should be sort the alphabets and numbers like => abcd123
so I have to find the integer in char array how could I separate that.
Sort the array. All the digits will be in a group (either before or after the letters, depending on character set supported by your compiler and host system). Shift that group to the end of the array if it is not already there.
But how I can identify number and character in c?
If you want to identify if a char is a digit, #include <ctype.h> and use isdigit, or check that the char is between '0' and '9' inclusive.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)