Matt said:
Do we have sscanf feature in C++? I guess since C++ is superset of C.
So the following are valid C++ code. Is that true?
char* buf = "10:25:33";
sscanf(buf, "%d:%d:%d", &h, &m, &s);
Please advise. thanks!!
This one is perfectly valid C++ code:
#include <stdio.h>
int main()
{
int h, m ,s;
char* buf = "10:25:33";
sscanf(buf, "%d %d %d", &h, &m, &s);
}
With very few exceptions (meaning differences), C++ retains C90 as a subset.
As the C++ standard mentions:
"C++ is a general purpose programming language based on the C
programming language as described in ISO/IEC 9899:1990 Programming
languages – C (1.2). In addition to the facilities provided by C, C++
provides additional data types, classes, templates, exceptions,
namespaces, inline functions, operator overloading, function name
overloading, references, free store management operators, and additional
library facilities."