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

C / C++ / MFC

 
GeneralRe: CWebBrowser Getting Source Code Pin
Ravi Bhavnani20-Jun-05 12:51
professionalRavi Bhavnani20-Jun-05 12:51 
Questionhow can I make password to my prog. Pin
suroor45320-Jun-05 10:16
suroor45320-Jun-05 10:16 
AnswerRe: how can I make password to my prog. Pin
David Crow20-Jun-05 10:58
David Crow20-Jun-05 10:58 
GeneralRe: how can I make password to my prog. Pin
suroor45320-Jun-05 11:25
suroor45320-Jun-05 11:25 
AnswerRe: how can I make password to my prog. Pin
Ritu Kwatra20-Jun-05 18:26
Ritu Kwatra20-Jun-05 18:26 
GeneralRe: how can I make password to my prog. Pin
ThatsAlok20-Jun-05 18:46
ThatsAlok20-Jun-05 18:46 
AnswerRe: how can I make password to my prog. Pin
namaskaaram20-Jun-05 20:15
namaskaaram20-Jun-05 20:15 
GeneralRe: how can I make password to my prog. Pin
suroor45321-Jun-05 1:48
suroor45321-Jun-05 1:48 
GeneralLaunch Applications directly from Embedded Resources Pin
Member 269513020-Jun-05 10:03
Member 269513020-Jun-05 10:03 
GeneralRe: Launch Applications directly from Embedded Resources Pin
Steve Maier20-Jun-05 10:29
professionalSteve Maier20-Jun-05 10:29 
GeneralOnInitDialog query Pin
Sonix20-Jun-05 9:36
Sonix20-Jun-05 9:36 
GeneralRe: OnInitDialog query Pin
David Crow20-Jun-05 9:42
David Crow20-Jun-05 9:42 
GeneralRe: OnInitDialog query Pin
Sonix20-Jun-05 9:50
Sonix20-Jun-05 9:50 
GeneralRe: OnInitDialog query Pin
David Crow20-Jun-05 9:56
David Crow20-Jun-05 9:56 
GeneralRe: OnInitDialog query Pin
20-Jun-05 10:05
suss20-Jun-05 10:05 
GeneralRe: OnInitDialog query Pin
FlyingTinman20-Jun-05 10:10
FlyingTinman20-Jun-05 10:10 
GeneralRe: OnInitDialog query Pin
Andrew Kirillov20-Jun-05 10:38
Andrew Kirillov20-Jun-05 10:38 
GeneralRe: OnInitDialog query Pin
Trollslayer20-Jun-05 13:14
mentorTrollslayer20-Jun-05 13:14 
Questionsimple keyboard input ? Pin
bitsNbites20-Jun-05 9:04
bitsNbites20-Jun-05 9:04 
AnswerRe: simple keyboard input ? Pin
Alexander M.,20-Jun-05 9:25
Alexander M.,20-Jun-05 9:25 
AnswerRe: simple keyboard input ? Pin
David Crow20-Jun-05 9:45
David Crow20-Jun-05 9:45 
AnswerRe: simple keyboard input ? Pin
Andrew Walker20-Jun-05 14:03
Andrew Walker20-Jun-05 14:03 
AnswerRe: simple keyboard input ? Pin
ng kok chuan20-Jun-05 17:25
ng kok chuan20-Jun-05 17:25 
is there any limitations on the type used? i guess this is for a school project right? if your project does not have any limitations, use the string class.

#include <iostream>
using std::cout;
using std::endl;
using std::cin;

#include <string>
using std::string;
using std::getline;


int main()
{
string test;

cout << "name :";
getline(cin,test);


cout << "Hello " << test << endl;
return 1;
}

this effectively removes any limitiations on character size inputs, which imho, is bad. imagine you have an indian name (no offence intended) and an english name. normally indian names are longer, so if you used a larger array size, the english name wastes a lot of memory. string dynamically allocates the memory spaces, so nothing is wasted. and you don't have to explicitly deal with the memory size (i.e. no magic numbers).

lastly, you'll find that getline will require you to press return twice to get the line if u're using vc++. this is a bug in the implementation of string. follow http://www.tek-tips.com/faqs.cfm?fid=5193 to fix the bug.

hope this is clear enough.

"Learning does not make one learned: there are those who have knowledge and those who have understanding. The first requires memory, the second philosophy." - Abbe Faria, The Count on Monte Cristo
GeneralRe: simple keyboard input ? Pin
bitsNbites20-Jun-05 18:06
bitsNbites20-Jun-05 18:06 
GeneralRe: simple keyboard input ? Pin
ng kok chuan20-Jun-05 21:33
ng kok chuan20-Jun-05 21:33 

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.