Click here to Skip to main content
15,913,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe:MessageBox not showing Pin
Andrew Brock12-Jan-11 20:00
Andrew Brock12-Jan-11 20:00 
QuestionRe:MessageBox not showing Pin
Cool_Dev12-Jan-11 21:15
Cool_Dev12-Jan-11 21:15 
AnswerRe:MessageBox not showing Pin
Hamid_RT12-Jan-11 22:39
Hamid_RT12-Jan-11 22:39 
QuestionGetting logical drives of all Physical drives Pin
learningvisualc12-Jan-11 19:03
learningvisualc12-Jan-11 19:03 
AnswerRe: Getting logical drives of all Physical drives Pin
Andrew Brock12-Jan-11 19:17
Andrew Brock12-Jan-11 19:17 
QuestionHow can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 18:39
Le@rner12-Jan-11 18:39 
AnswerRe: How can Terminate AfxbeginThread ? [modified] Pin
Andrew Brock12-Jan-11 18:58
Andrew Brock12-Jan-11 18:58 
GeneralRe: How can Terminate AfxbeginThread ? [modified] Pin
Le@rner12-Jan-11 19:12
Le@rner12-Jan-11 19:12 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 19:24
Andrew Brock12-Jan-11 19:24 
GeneralRe: How can Terminate AfxbeginThread ? [modified] Pin
Le@rner12-Jan-11 19:26
Le@rner12-Jan-11 19:26 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 20:35
Andrew Brock12-Jan-11 20:35 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 20:40
Le@rner12-Jan-11 20:40 
AnswerRe: How can Terminate AfxbeginThread ? [modified] Pin
Andrew Brock12-Jan-11 20:58
Andrew Brock12-Jan-11 20:58 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 21:17
Le@rner12-Jan-11 21:17 
AnswerRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 21:21
Andrew Brock12-Jan-11 21:21 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 21:30
Le@rner12-Jan-11 21:30 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 22:26
Andrew Brock12-Jan-11 22:26 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 23:13
Le@rner12-Jan-11 23:13 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock13-Jan-11 0:11
Andrew Brock13-Jan-11 0:11 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 23:42
Le@rner12-Jan-11 23:42 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 23:56
Andrew Brock12-Jan-11 23:56 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 23:59
Le@rner12-Jan-11 23:59 
AnswerRe: How can Terminate AfxbeginThread ? Pin
Prasann Mayekar12-Jan-11 18:59
Prasann Mayekar12-Jan-11 18:59 
AnswerRe: How can Terminate AfxbeginThread ? Pin
Cedric Moonen12-Jan-11 20:49
Cedric Moonen12-Jan-11 20:49 
QuestionWhile Statement Issue. Pin
Mike Certini12-Jan-11 17:53
Mike Certini12-Jan-11 17:53 
In the below code I have put together a text example of a shopping cart whereby the user selects a commodity to purchase and based upon a menu selection, tells the program which leg in my switch statement to execute. After a selection is made, the program drops out of the switch statement and proceeds the the bottom of the while statement where "ordercom" tells the while statement to continue taking orders. This is obviously an un-ending loop but is coded this way to trouble shoot the issue at hand. I am testing the code with code breaks. What is happening is that after I select two menu selections or two loops of the while statement the program skips over the scanf statement.
Can someone help me with this issue?

#include <stdio.h>
#define Artichoke 1.25
#define Beets .65
#define Carrots .89
#define Discount .05
#define Shipping1 10.00
#define Shipping2 8.00

int main(void)
	{
	char ordercom;
	char type;
	float pounds;
	float gross;
	float poundTot = 0;
	ordercom = 'Y';
	while(ordercom == 'Y')
		{
		printf("*******************************************************************************************************************\n");
		printf("Determine What You Want To Buy\n");
		printf("1) (a)\t	Artichokes\t		3) (c)\t   Carrots\n");
		printf("2) (b)\t	Beets\t				4) (q)\t   Quit\n");
		printf("*******************************************************************************************************************\n");
		printf("\n");
		printf("Select The Type Of Vegetable You Want And The Pounds Of The Vegetable You Want Or (q) To Quit :");
		scanf("%c ""%f",&type,&pounds);
		
		switch(type)
			{
			case 'a' :
				{
				gross = pounds * Artichoke;
				break;
				}
			case 'b' :
				{
				gross = pounds * Beets;
				break;
				}
			case 'c' :
				{
				gross = pounds * Carrots;
				break;
				}
			case 'q' :
				{
				break;
				}
			default  :
				{
				break;
				}
			}
		ordercom = 'Y';
		}
	
	}

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.