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..
This is a discussion on how to find numbers in a char array. within the C Programming forums, part of the General Programming Boards category; 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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
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.
Right 98% of the time, and don't care about the other 3%.
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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way