Skip to main content
1 de 3

How can I, depending on the sign (+, -, *, /) the program can be executed: ex: ./hello 2 + 2

As I do, depending on the math signs, the program can be executed, I use the switch so that depending on the cases the user only puts ex: 2 + 2 the program says heyyy put a + that's the 2nd case then it executes the code afterwards but it detects me Switch my string .... so if I convert it to int .... wrong, long .... no ..... then I don't know what to do.

introducir la descripción de la imagen aquí