Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Image in CListCtrl Pin
led mike26-Mar-07 6:04
led mike26-Mar-07 6:04 
QuestionQuestion on ToolTip [modified] Pin
Super Hornet26-Mar-07 4:43
Super Hornet26-Mar-07 4:43 
QuestionImplimentation of user defined cursor & icon in application window. Pin
its_me_shailesh26-Mar-07 4:29
its_me_shailesh26-Mar-07 4:29 
AnswerRe: Implimentation of user defined cursor & icon in application window. Pin
_AnsHUMAN_ 26-Mar-07 4:34
_AnsHUMAN_ 26-Mar-07 4:34 
AnswerRe: Implimentation of user defined cursor & icon in application window. Pin
prasad_som26-Mar-07 5:38
prasad_som26-Mar-07 5:38 
QuestionRemove Null Character Pin
Programm3r26-Mar-07 3:23
Programm3r26-Mar-07 3:23 
AnswerRe: Remove Null Character Pin
Christian Graus26-Mar-07 3:48
protectorChristian Graus26-Mar-07 3:48 
QuestionHelp with vector/array Pin
klutez12326-Mar-07 3:11
klutez12326-Mar-07 3:11 
I need help with the following code that will also output the warmest and coldest days entered:

// Compiler Directives<br />
#include "stdafx.h"<br />
#include "hightemp.h"<br />
#include <vector>                            <br />
#include <fstream><br />
#include <iostream><br />
#include <iomanip><br />
#include <string><br />
<br />
<br />
// Global Declarations<br />
using namespace std;<br />
CWinApp TheApp;<br />
<br />
/*****************************************************<br />
*                        MAIN                        *<br />
*****************************************************/<br />
<br />
int main()<br />
{<br />
  vector <int> daily_temp(31,0); // array of daily high temperatures<br />
  int num_values;                // number of days in a row to enter values<br />
  int index;                     // index for loop counter and array access<br />
  double average_high;           // calculated average high temperature<br />
  int total = 0;                 // used to total temps before averaging<br />
<br />
  do  // loop to ask for number of days until valid input is received<br />
  {<br />
    cout << "Enter the number of days for which you have data: ";<br />
    cin >> num_values;<br />
    if ((num_values < 1) || (num_values > 31))<br />
     {<br />
      cout << "The number of days must be in the range 1 to 31"<br />
	       << endl;<br />
     }<br />
  } while ((num_values < 1) || (num_values > 31));<br />
<br />
  // The following loop gets the high temperatures from the user for as<br />
  // many days as the user specified in num_values.<br />
  for(index = 0; index <= (num_values - 1); index++)<br />
   {<br />
    cout << "Enter the high temperature for day " << index + 1 << ": ";<br />
    cin >> daily_temp[index];  // input value into array<br />
   }<br />
<br />
  // Print the values in the array to the screen.<br />
  cout << "The array contains high temperatures for " << num_values<br />
       << " days.\n";<br />
  cout << "The values are as follows.\n";<br />
  for(index = 0; index <= (num_values - 1); index++)<br />
   {<br />
    cout << "Day " << index + 1 << ": " << daily_temp[index] << endl;<br />
    total = total + daily_temp[index]; // update total for averaging<br />
   }<br />
<br />
  // Calculate average by typecasting total and num_values to doubles<br />
  // before dividing and assigning the result to average_high.<br />
  average_high = double(total) / double(num_values);<br />
<br />
  // Print the results to the screen.<br />
  cout.setf(ios::fixed);<br />
  cout << "The average high temperature during the " << num_values<br />
       << "-day period was " << setprecision(2) << average_high<br />
       << " degrees.\n";<br />
<br />
  return 0;<br />
}<br />

QuestionRe: Help with vector/array Pin
prasad_som26-Mar-07 3:16
prasad_som26-Mar-07 3:16 
AnswerRe: Help with vector/array Pin
klutez12326-Mar-07 3:24
klutez12326-Mar-07 3:24 
GeneralRe: Help with vector/array Pin
Maximilien26-Mar-07 3:37
Maximilien26-Mar-07 3:37 
AnswerRe: Help with vector/array Pin
David Crow26-Mar-07 4:05
David Crow26-Mar-07 4:05 
AnswerRe: Help with vector/array Pin
Stephen Hewitt26-Mar-07 13:29
Stephen Hewitt26-Mar-07 13:29 
Questionhow to get mouseposition outside window Pin
Goggelmoggel26-Mar-07 3:04
Goggelmoggel26-Mar-07 3:04 
AnswerRe: how to get mouseposition outside window Pin
Christian Graus26-Mar-07 3:08
protectorChristian Graus26-Mar-07 3:08 
AnswerRe: how to get mouseposition outside window Pin
prasad_som26-Mar-07 3:10
prasad_som26-Mar-07 3:10 
AnswerRe: how to get mouseposition outside window Pin
Emil - Gabriel26-Mar-07 3:17
Emil - Gabriel26-Mar-07 3:17 
QuestionProblem with connecting to MySQL db from my own windows service application Pin
anumadhu26-Mar-07 2:50
anumadhu26-Mar-07 2:50 
AnswerRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD26-Mar-07 10:16
JudyL_MD26-Mar-07 10:16 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu27-Mar-07 1:43
anumadhu27-Mar-07 1:43 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD27-Mar-07 3:08
JudyL_MD27-Mar-07 3:08 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu27-Mar-07 3:28
anumadhu27-Mar-07 3:28 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD27-Mar-07 3:42
JudyL_MD27-Mar-07 3:42 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
anumadhu27-Mar-07 4:13
anumadhu27-Mar-07 4:13 
GeneralRe: Problem with connecting to MySQL db from my own windows service application Pin
JudyL_MD27-Mar-07 4:19
JudyL_MD27-Mar-07 4:19 

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.