I have a text file which has the following format.....

129.2.3.87 18.3.6.77 5655 2333


here the first field is source ip address then destination ip address then source port and destination port


there are many such entries..... i want to know how do i extract these fields using c program code....

it would be a great help... thanks in advance.......

You can parse the string looking for spaces using the function strtok.
Or you can do it in this way

commented: For giving helpful links and not just handing out code. +7
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.