so i'm learning about indirections, and i'd like to know how i may change the following code to obtain the .txt file from the internet instead of from my desktop.
simply changing the file's address to an http address doesn't work.
any thoughts?
PHP:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
FILE *textFile = fopen ("/Users/me/Desktop/textFile.txt", "r");
char word[100];
while (fgets(word, 100, textFile))
{
word[strlen(word) - 1] = '\0';
NSLog (@"%s is %d characters long", word, strlen(word));
}
fclose (textFile);
return (0);
}
simply changing the file's address to an http address doesn't work.
any thoughts?