Reputation: 133
I'm using:
char s[20]=system("vcgencmd | egrep "[0-9.]{4,}" -o");
The system()
function has problems with the the number of quotation marks.
Upvotes: 0
Views: 1315
Reputation: 186
If your intent is to have a traditional C-style string that contains double quotation characters, then you can just restructure your expression to be the following:
char s[20] = system("vcgencmd | egrep \"[0-9.]{4,}\" -o");
In this case, each double quotation mark that appears inside the string is denoted by \"
the \
character is called an Escape Character.
Upvotes: 2