0

Hello All,

how can I create a member function for a class that is reading from a txt file, which is reading computer network addresses and names for the addresses.

I was guessing they need to be string and 4 ints data type.

Example of data.txt file input
111.22.3.3 "green
111.22.44.4 " purple"

also with the option to read 100 addresses

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by dkalita
0

>>I was guessing they need to be string and 4 ints data type.

That would be a description of the member variables needed for a class such as you describe.

0

Hello All,

how can I create a member function for a class that is reading from a txt file, which is reading computer network addresses and names for the addresses.

I was guessing they need to be string and 4 ints data type.

Example of data.txt file input
111.22.3.3 "green
111.22.44.4 " purple"

also with the option to read 100 addresses

u better use two strings: 1 for the IP , 1 for the name. Thats enough. It will consume less memory as by int and will be easy for further use in methods like socket(), connect() etc wherever required.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.