c - How do i count the number of elements on a given line of a file? -


something along line of:

int n = sscanf(%s %s ... 

it save how many string element on given line in int n,

the file can contain many lines each line having many elements e.g.

efefefef efefef dfefe fefef  eef efef efef efefef efefef efefef efefe efeefef [wdfefefef] 

first line n = 2 ; second line n = 6

also how should remove brackets strings thr string inside bracket?

regards

presuming 'element' mean word, best bet use strtok , pass appropriate list of terminators (which include space, '[', ']', etc.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -