Click here to Skip to main content
15,877,574 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Running a process as Administrator in Vista, Windows 2008? [modified] Pin
Randor 31-Oct-09 1:50
professional Randor 31-Oct-09 1:50 
GeneralRe: Running a process as Administrator in Vista, Windows 2008? Pin
Kushagra Tiwari31-Oct-09 2:11
Kushagra Tiwari31-Oct-09 2:11 
GeneralRe: Running a process as Administrator in Vista, Windows 2008? Pin
Randor 31-Oct-09 2:18
professional Randor 31-Oct-09 2:18 
GeneralRe: Running a process as Administrator in Vista, Windows 2008? Pin
Kushagra Tiwari31-Oct-09 2:22
Kushagra Tiwari31-Oct-09 2:22 
QuestionRe: Running a process as Administrator in Vista, Windows 2008? Pin
Kushagra Tiwari1-Nov-09 19:51
Kushagra Tiwari1-Nov-09 19:51 
QuestionTrying to send a pdf file using Sockets Pin
WindowsVsLinux30-Oct-09 22:10
WindowsVsLinux30-Oct-09 22:10 
AnswerRe: Trying to send a pdf file using Sockets Pin
Richard MacCutchan31-Oct-09 0:43
mveRichard MacCutchan31-Oct-09 0:43 
Questioncin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:21
CaptainSeeSharp30-Oct-09 19:21 
Embarrassing as this code may be to me (I am a bit of a C++ noob), why don't the third console input take? It acts like I held down the enter key after entering my height in inches.

This sample is part of an exercise from a book.
#include <iostream>

using namespace std;

const unsigned char inchesInFoot = 12;
const float metersInInch = 0.0254;
const float poundsInKilogram = 2.2;

int main()
{
  unsigned char userFeet, userInches;
  unsigned short userPounds;

  float userMeters;
  float userKilograms;

  cout << "Enter your height in feet:";
  cin >> userFeet;
  cout << "Now enter the remaining inches of your height:";
  cin >> userInches;
  cout << "How many pounds do you weight?:";

  cin >> userPounds; //blazes right by this

  userInches = userFeet * inchesInFoot + userInches;
  userMeters = userInches * metersInInch;
  userKilograms = userPounds / poundsInKilogram;

  cout << "Your BMI is " << userKilograms / (userMeters * userMeters) << endl;

  return 0;
}



AnswerRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:37
LunaticFringe30-Oct-09 19:37 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:41
CaptainSeeSharp30-Oct-09 19:41 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
N a v a n e e t h30-Oct-09 19:46
N a v a n e e t h30-Oct-09 19:46 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:48
CaptainSeeSharp30-Oct-09 19:48 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:47
LunaticFringe30-Oct-09 19:47 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:50
CaptainSeeSharp30-Oct-09 19:50 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:55
LunaticFringe30-Oct-09 19:55 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 20:02
CaptainSeeSharp30-Oct-09 20:02 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 20:14
LunaticFringe30-Oct-09 20:14 
GeneralRe: cin &gt;&gt; foo; Sometimes it doesn't take... Pin
Randor 30-Oct-09 22:31
professional Randor 30-Oct-09 22:31 
QuestionLPCSTR and char* issues Pin
MbHimself30-Oct-09 17:34
MbHimself30-Oct-09 17:34 
AnswerRe: LPCSTR and char* issues [modified] Pin
LunaticFringe30-Oct-09 18:46
LunaticFringe30-Oct-09 18:46 
GeneralRe: LPCSTR and char* issues Pin
MbHimself30-Oct-09 19:09
MbHimself30-Oct-09 19:09 
GeneralRe: LPCSTR and char* issues Pin
LunaticFringe30-Oct-09 19:42
LunaticFringe30-Oct-09 19:42 
AnswerRe: LPCSTR and char* issues Pin
«_Superman_»30-Oct-09 19:40
professional«_Superman_»30-Oct-09 19:40 
Questionhow to use a matrix associeted to control variables ? Pin
timbk30-Oct-09 13:32
timbk30-Oct-09 13:32 
AnswerRe: how to use a matrix associeted to control variables ? Pin
«_Superman_»30-Oct-09 15:55
professional«_Superman_»30-Oct-09 15:55 

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.