Click here to Skip to main content
16,019,619 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: random numbers Pin
MsmVc8-Mar-10 19:16
MsmVc8-Mar-10 19:16 
GeneralRe: random numbers [modified] Pin
Cool_Dev8-Mar-10 19:18
Cool_Dev8-Mar-10 19:18 
GeneralRe: random numbers Pin
MsmVc8-Mar-10 22:09
MsmVc8-Mar-10 22:09 
GeneralRe: random numbers Pin
CPallini8-Mar-10 20:46
mveCPallini8-Mar-10 20:46 
AnswerRe: random numbers Pin
David Crow9-Mar-10 2:19
David Crow9-Mar-10 2:19 
QuestionFailed to Update system registry Pin
Pryabu8-Mar-10 17:54
Pryabu8-Mar-10 17:54 
AnswerRe: Failed to Update system registry Pin
22491715-Mar-10 14:07
22491715-Mar-10 14:07 
QuestionStruct Prob Pin
Herboren8-Mar-10 15:14
Herboren8-Mar-10 15:14 
I was reading about structers in Oriely's c++ and well unfortunately I couldnt buy the book, but I took photos with my phone and what I did what write my own code and i get no errors when I compile it. This is my code:

// Virtual Structure.cpp : Defines the entry point for the console application.
//

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

struct Virtual_Bin{
	int Type;
	int Quantity;
	double Price;
} Produce_Choice;

int _tmain(int argc, _TCHAR* argv[])
{
	double i;
	Virtual_Bin Produce_Choice; //Produce - My virtual Bin stores information based on produce.

	cout << "  Fruit Type: "; cin >> Produce_Choice.Type;
	cout << "Fruit Amount: "; cin >> Produce_Choice.Quantity;
	cout << " Fruit Price: "; cin >> Produce_Choice.Price;

	cout << "      Type: " << Produce_Choice.Type << endl;
	cout << "  Quantity: " << Produce_Choice.Quantity << endl;
	cout << "Price Each: " << Produce_Choice.Price << endl;

	i = Produce_Choice.Quantity * Produce_Choice.Price;
	cout << "Total for quantity of " << Produce_Choice.Quantity << ": " << i;
    
	_getch();
	return 0;
}


My Build:
------ Build started: Project: Virtual Structure, Configuration: Debug Win32 ------

Virtual Structure - up-to-date.


---------------------- Done ----------------------

    Build: 1 succeeded, 0 failed, 0 skipped


My output on the screen is:

  Fruit Type: Apple
Fruit Amount:  Fruit Price:       Type: -858993460
  Quantity: -858993460
Price Each: -9.25596e+061
Total for quantity of -858993460: 7.95081e+070

AnswerRe: Struct Prob Pin
tibiz8-Mar-10 15:31
tibiz8-Mar-10 15:31 
GeneralRe: Struct Prob [modified] Pin
Herboren8-Mar-10 15:38
Herboren8-Mar-10 15:38 
QuestionGetting rid of security questions when accessing registry Vista, Win 7 [modified] Pin
tibiz8-Mar-10 15:03
tibiz8-Mar-10 15:03 
AnswerRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
Chris Losinger8-Mar-10 16:02
professionalChris Losinger8-Mar-10 16:02 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
tibiz8-Mar-10 23:34
tibiz8-Mar-10 23:34 
AnswerRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
Iain Clarke, Warrior Programmer8-Mar-10 21:47
Iain Clarke, Warrior Programmer8-Mar-10 21:47 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
tibiz8-Mar-10 23:31
tibiz8-Mar-10 23:31 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
Mohan Ramachandra9-Mar-10 1:21
Mohan Ramachandra9-Mar-10 1:21 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
tibiz9-Mar-10 1:43
tibiz9-Mar-10 1:43 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
Mohan Ramachandra9-Mar-10 2:18
Mohan Ramachandra9-Mar-10 2:18 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
tibiz9-Mar-10 8:50
tibiz9-Mar-10 8:50 
GeneralRe: Getting rid of security questions when accessing registry Vista, Win 7 Pin
Mohan Ramachandra9-Mar-10 17:59
Mohan Ramachandra9-Mar-10 17:59 
QuestionCan't compile any code with Dev C++. Pin
James_7228-Mar-10 11:31
James_7228-Mar-10 11:31 
AnswerRe: Can't compile any code with Dev C++. Pin
Luc Pattyn8-Mar-10 12:40
sitebuilderLuc Pattyn8-Mar-10 12:40 
AnswerRe: Can't compile any code with Dev C++. Pin
Herboren8-Mar-10 15:40
Herboren8-Mar-10 15:40 
QuestionInitializer lists, default constructors and references Pin
CString(0xcccccccc)8-Mar-10 8:52
CString(0xcccccccc)8-Mar-10 8:52 
AnswerRe: Initializer lists, default constructors and references Pin
Stuart Dootson8-Mar-10 9:01
professionalStuart Dootson8-Mar-10 9:01 

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.