LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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

Reply
 
Search this Thread
Old 06-13-2007, 01:50 PM   #16
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled

Oops, <iostream> does it. My mistake.
 
Old 06-13-2007, 01:58 PM   #17
nmansour
Member
 
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101

Original Poster
Rep: Reputation: 15
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.
 
Old 06-13-2007, 02:03 PM   #18
Avinash
LQ Newbie
 
Registered: Dec 2006
Posts: 11

Rep: Reputation: 0
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.
 
Old 06-13-2007, 02:13 PM   #19
nmansour
Member
 
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101

Original Poster
Rep: Reputation: 15
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
 
Old 06-13-2007, 02:20 PM   #20
nmansour
Member
 
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101

Original Poster
Rep: Reputation: 15
Why do I get this error?
Code:
code.cpp:9:2: warning: no newline at end of file
 
Old 06-13-2007, 02:27 PM   #21
Avinash
LQ Newbie
 
Registered: Dec 2006
Posts: 11

Rep: Reputation: 0
That's not an "error" it's a warning. Go to the last line and hit enter.

-Avi
 
Old 06-13-2007, 02:33 PM   #22
nmansour
Member
 
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101

Original Poster
Rep: Reputation: 15
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
 
Old 06-13-2007, 02:34 PM   #23
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.
 
Old 06-13-2007, 02:38 PM   #24
nmansour
Member
 
Registered: Sep 2006
Location: Chicago
Distribution: Ubuntu 8.04 - Fedora 9 on an AMD 64bit Machine
Posts: 101

Original Poster
Rep: Reputation: 15
Nylex,

thanks for the efforts,

Noha
 
  


Reply

Tags
automated, downloading, wget


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small database program? PatrickMay16 General 1 06-14-2006 11:32 PM
Please help me with small college program stuckatc Linux - Software 4 06-02-2006 07:13 AM
please help with small sort program stuckatc Linux - Newbie 1 06-01-2006 01:17 PM
Need help with small program batalia Linux - Newbie 8 11-07-2005 02:41 PM
Compile a small program Dauer Ubuntu 2 11-05-2005 04:17 AM


All times are GMT -5. The time now is 08:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration