How can i make sscanf() skip all whitespace characters?I read from a file and i dont know where are the characters.
eg.->@Solomon Islands ,i need "Solomon Islands" in one string
e.g->AGAF (AFT) – Afutara Airport – Afutara ,i need "Afutara Airport" in one string.
kavourdoukos
0
Newbie Poster
Recommended Answers
Jump to PostHow can i make sscanf() skip all whitespace characters?
It's awkward for string data. You might be better off manually extracting the data you want.
eg.->@Solomon Islands ,i need "Solomon Islands" in one string
The boundary characters matter. I assume the string starts with '@', but if it ends with …
Jump to PostIf i want to read this line-->AGAR (RNA) – Ulawa Airport – Arona, Ulawa Island
and store:
AGAR in var1
RNA in var2
Ulawa Airport in var3
Arona, Ulawa Island in var4this command is ok?
sscanf(buffer, "%s (%s) %*[^-]- %[^-] %s", var1,var2,var3,var4);
I dont think so..Anybody that can …
All 7 Replies
Narue
5,707
Bad Cop
Team Colleague
kavourdoukos
0
Newbie Poster
Aia
1,977
Nearly a Posting Maven
kavourdoukos
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
Aia
1,977
Nearly a Posting Maven
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.