Advertisement

String Manipulation

Started by March 01, 2002 04:05 PM
0 comments, last by steveharper101 22 years, 11 months ago
I Know this is a really simple problem. But i can''t seam to be able to load some IP adresses from a file. How would i use fscanf to load an ip address into a string. I think you can use a byte data type to store each individual number after the dot''s but this dosen''t seam to work :-(. I know it''s abit abstract but any help will do. Thanks Alot :-) ~Steve~
//255.255.255.255

char address[15];
FILE *instream;

instream= fopen("whatever.something","r");

fgets(address,15,instream);


This will read the entire line in and store it as address.
Hope this helps...

If at first you don't suceed do something easier!.

This topic is closed to new replies.

Advertisement