Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
06-13-2007, 01:50 PM
#16
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,370
Rep:
Oops, <iostream> does it. My mistake.
06-13-2007, 01:58 PM
#17
Member
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101
Original Poster
Rep:
Nylex, post#13;
But this will end up with 3 'cout' statements, right? so what is the difference with the first code I coud get (post #7)?
Avinash,
To have all the 114 files should it be like this?
Code:
#include <iostream>
using namespace std;
int main()
{
for (int i=1; i<100; i++)
printf("http://download.quran.islamway.com/quran3/236/%.3d.rm\n",i);
for (int i=100; i<115; i++)
printf("http://download.quran.islamway.com/quran3/236/%.rm\n",i);
return 0;
}
Thanks,
Noha
Last edited by nmansour; 06-13-2007 at 01:59 PM .
06-13-2007, 02:03 PM
#18
LQ Newbie
Registered: Dec 2006
Posts: 11
Rep:
To have it go to 114, change the value of i to 115
Code:
#include <iostream>
using namespace std;
int main()
{
for (int i=1; i<115; i++)
printf("http://download.quran.islamway.com/quran3/236/%.3d.rm\n",i);
return 0;
}
Run that code, and watch what it does.
The printf portion should be understood to see why this works.
Last edited by Avinash; 06-13-2007 at 02:06 PM .
06-13-2007, 02:13 PM
#19
Member
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101
Original Poster
Rep:
It is working, thanks.
I have directed the output to a text file and used wget to get the files. Same as it is in #7, though.
Thank you, it was quite a lesson!
Noha
06-13-2007, 02:20 PM
#20
Member
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101
Original Poster
Rep:
Why do I get this error?
Code:
code.cpp:9:2: warning: no newline at end of file
06-13-2007, 02:27 PM
#21
LQ Newbie
Registered: Dec 2006
Posts: 11
Rep:
That's not an "error" it's a warning. Go to the last line and hit enter.
-Avi
06-13-2007, 02:33 PM
#22
Member
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101
Original Poster
Rep:
Oh, it tells about something missing, not asking to remove something! I made all possible ways to ensure there are NO new lines at the end of file
Thanks a lot
Noha
06-13-2007, 02:34 PM
#23
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,370
Rep:
Quote:
Originally Posted by nmansour
Nylex, post#13;
But this will end up with 3 'cout' statements, right? so what is the difference with the first code I coud get (post #7)?
Personal preference I guess.
06-13-2007, 02:38 PM
#24
Member
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101
Original Poster
Rep:
Nylex,
thanks for the efforts,
Noha
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 02:47 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News