I have the following code:
scanf(\" %Xs %Ys\", buf1, buf2);
Where X and Y should be integers. The problem is that the values for X and Y ar
Your question is not clear. If you don't know the values, then they are probably run-time constants, not compile-time constants.
If that's the case (i.e. they are run-time consants), then no, there's no such feature in 'scanf'. The only thing you can do is to produce the complete format string (with the concrete values embedded in it) at run-time by using 'sprintf' and then pass that format string to your 'scanf'.