Click here to Skip to main content
15,891,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WriteProfileString Pin
Rajesh R Subramanian5-Apr-07 0:34
professionalRajesh R Subramanian5-Apr-07 0:34 
QuestionDisable pause/break key in console application Pin
yccheok4-Apr-07 23:17
yccheok4-Apr-07 23:17 
QuestionHow to implement array of strings Pin
yaminisridaran4-Apr-07 22:53
yaminisridaran4-Apr-07 22:53 
AnswerRe: How to implement array of strings Pin
CPallini4-Apr-07 23:03
mveCPallini4-Apr-07 23:03 
GeneralRe: How to implement array of strings Pin
yaminisridaran6-Apr-07 18:29
yaminisridaran6-Apr-07 18:29 
QuestionMemory leak in ADO CreateParameter Pin
voorugonda prashanth4-Apr-07 21:20
voorugonda prashanth4-Apr-07 21:20 
AnswerRe: Memory leak in ADO CreateParameter Pin
Dmitry Khudorozhkov4-Apr-07 23:15
Dmitry Khudorozhkov4-Apr-07 23:15 
QuestionStill need a bit of help please Pin
planetx224-Apr-07 21:14
planetx224-Apr-07 21:14 
Ok, so thanks to the help I have the program working somewhat correctly, I think. It has 2 loops, a for and while.. one allows the user to keep inputting data into an array that will be defined by the user in size but is no more than 50 values. I have a while loop in this that will ask user to input 1 to continue, 0 to stop entering temperatures. My problem is, I think the values are being stored correctly cause when i choose to output say myarray[0] the correct value I input comes up, but I want to be able to print out how many actual arrays there are in a statement like "Number of readings entered is 12," not the values in them (although I hope i stored each one properly).

This is where I am stuck. From here I have to take the data and make sure its all in centigrade. Im pretty sure I can write a basic function to do this part, but how do I make a statement to call this in my loop as the user inputs functions, and then prints out how many there are? Any help much appreciated thanks.





// Computer Lab test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

double myarray[51];
int i;
int flag;
flag=1;
for(i= 0; i < 50; i++)
while (flag==1)
{
// loop to enter temperatures - pressing 1 continues, pressing 0 stops //
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}
std::cout << myarray[i] << std::endl;

return 0;
}
AnswerRe: Still need a bit of help please Pin
Nibu babu thomas4-Apr-07 21:27
Nibu babu thomas4-Apr-07 21:27 
GeneralRe: Still need a bit of help please Pin
planetx224-Apr-07 21:31
planetx224-Apr-07 21:31 
GeneralRe: Still need a bit of help please Pin
Nibu babu thomas4-Apr-07 21:35
Nibu babu thomas4-Apr-07 21:35 
GeneralRe: Still need a bit of help please Pin
planetx224-Apr-07 21:55
planetx224-Apr-07 21:55 
GeneralRe: Still need a bit of help please Pin
David Crow5-Apr-07 3:09
David Crow5-Apr-07 3:09 
QuestionWhy does WM_PAINT exclude DrawItem? Pin
zouchao11124-Apr-07 20:51
zouchao11124-Apr-07 20:51 
AnswerRe: Why does WM_PAINT exclude DrawItem? Pin
Nibu babu thomas4-Apr-07 21:37
Nibu babu thomas4-Apr-07 21:37 
QuestionListCtrl header height in report view Pin
Nishad S4-Apr-07 20:20
Nishad S4-Apr-07 20:20 
QuestionRe: ListCtrl header height in report view Pin
Nibu babu thomas4-Apr-07 20:31
Nibu babu thomas4-Apr-07 20:31 
AnswerRe: ListCtrl header height in report view Pin
Nishad S4-Apr-07 20:36
Nishad S4-Apr-07 20:36 
GeneralRe: ListCtrl header height in report view Pin
Nibu babu thomas4-Apr-07 20:54
Nibu babu thomas4-Apr-07 20:54 
AnswerRe: ListCtrl header height in report view Pin
Naveen4-Apr-07 20:52
Naveen4-Apr-07 20:52 
GeneralRe: ListCtrl header height in report view [modified] Pin
Nishad S4-Apr-07 21:05
Nishad S4-Apr-07 21:05 
GeneralRe: ListCtrl header height in report view [modified] Pin
bosfan4-Apr-07 21:40
bosfan4-Apr-07 21:40 
GeneralRe: ListCtrl header height in report view Pin
Nishad S4-Apr-07 23:45
Nishad S4-Apr-07 23:45 
GeneralRe: ListCtrl header height in report view Pin
bosfan5-Apr-07 2:20
bosfan5-Apr-07 2:20 
GeneralRe: ListCtrl header height in report view Pin
Nishad S5-Apr-07 2:27
Nishad S5-Apr-07 2:27 

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.