I have a string variable (It is a input from the user space ) and i need to pull two number inside of it . For example :
"123 + 12" i need to create 2 substring from it . "123" and "12" .
Format of this string always will be like in the examples : "12 + 1" , "1 * 1" , "432 - 232" etc so length of the string isn't a constant value . It is the biggest problem for me .
How can i take these two numbers from the string and convert them to two integer value ? Can you show me a simple example ? How can i split the string by space character in Linux Kernel ?