Click here to Skip to main content
15,902,189 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionvector of doubles (division) Pin
b-rad31127-May-10 9:57
b-rad31127-May-10 9:57 
AnswerRe: vector of doubles (division) Pin
loyal ginger27-May-10 10:10
loyal ginger27-May-10 10:10 
GeneralRe: vector of doubles (division) Pin
b-rad31127-May-10 11:02
b-rad31127-May-10 11:02 
GeneralRe: vector of doubles (division) Pin
b-rad31127-May-10 11:10
b-rad31127-May-10 11:10 
GeneralRe: vector of doubles (division) Pin
CPallini27-May-10 11:24
mveCPallini27-May-10 11:24 
GeneralRe: vector of doubles (division) Pin
b-rad31127-May-10 11:32
b-rad31127-May-10 11:32 
GeneralRe: vector of doubles (division) Pin
b-rad31127-May-10 11:41
b-rad31127-May-10 11:41 
GeneralRe: vector of doubles (division) Pin
CPallini27-May-10 21:17
mveCPallini27-May-10 21:17 
The following compiles (and runs) fine (I've a rather old VS2005 compiler...)
C++
#include <iostream>
#include <vector>
using namespace std;

int main()
{
  vector <double> vt;
  
  vt.push_back(7.0);
  vt.push_back(5.0);
  vt.push_back(3.0);

  double x = 5.0;

  vector<double>::iterator it = vt.begin(); 
  while (it != vt.end())
  {
    *it /= x;
    cout << *it << endl;
    it++;
  }
}

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: vector of doubles (division) Pin
b-rad31128-May-10 5:16
b-rad31128-May-10 5:16 
AnswerRe: vector of doubles (division) Pin
CPallini27-May-10 10:11
mveCPallini27-May-10 10:11 
AnswerRe: vector of doubles (division) Pin
Aescleal27-May-10 12:38
Aescleal27-May-10 12:38 
GeneralRe: vector of doubles (division) Pin
Stephen Hewitt27-May-10 20:15
Stephen Hewitt27-May-10 20:15 
GeneralRe: vector of doubles (division) Pin
Aescleal27-May-10 20:52
Aescleal27-May-10 20:52 
GeneralRe: vector of doubles (division) Pin
Stephen Hewitt27-May-10 21:40
Stephen Hewitt27-May-10 21:40 
GeneralRe: vector of doubles (division) Pin
Aescleal27-May-10 22:24
Aescleal27-May-10 22:24 
GeneralRe: vector of doubles (division) Pin
b-rad31128-May-10 5:24
b-rad31128-May-10 5:24 
GeneralRe: vector of doubles (division) Pin
Aescleal28-May-10 5:53
Aescleal28-May-10 5:53 
GeneralRe: vector of doubles (division) Pin
b-rad31128-May-10 6:05
b-rad31128-May-10 6:05 
GeneralRe: vector of doubles (division) Pin
Aescleal28-May-10 7:20
Aescleal28-May-10 7:20 
GeneralRe: vector of doubles (division) Pin
b-rad31128-May-10 7:28
b-rad31128-May-10 7:28 
AnswerRe: vector of doubles (division) Pin
Stephen Hewitt27-May-10 14:09
Stephen Hewitt27-May-10 14:09 
GeneralRe: vector of doubles (division) Pin
b-rad31128-May-10 5:17
b-rad31128-May-10 5:17 
QuestionShow message the first time my app is started after windows has rebooted Pin
manchukuo27-May-10 6:48
manchukuo27-May-10 6:48 
AnswerRe: Show message the first time my app is started after windows has rebooted Pin
David Crow27-May-10 7:32
David Crow27-May-10 7:32 
GeneralRe: Show message the first time my app is started after windows has rebooted Pin
manchukuo27-May-10 7:45
manchukuo27-May-10 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.