Click here to Skip to main content
15,885,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:48
CaptainSeeSharp30-Oct-09 19:48 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:47
LunaticFringe30-Oct-09 19:47 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 19:50
CaptainSeeSharp30-Oct-09 19:50 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 19:55
LunaticFringe30-Oct-09 19:55 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
CaptainSeeSharp30-Oct-09 20:02
CaptainSeeSharp30-Oct-09 20:02 
GeneralRe: cin >> foo; Sometimes it doesn't take... Pin
LunaticFringe30-Oct-09 20:14
LunaticFringe30-Oct-09 20:14 
GeneralRe: cin >> 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 
Hey, this is my first time posting anything on this forum. I need some help with this reoccurring problem. When I try to typecast a character pointer to a LPCSTR for some reason all of the string doesn't make it. When I try to pass it to a function that uses a LPCSTR it gets clipped at the whitespace. So if I use something like "This is a test." the only thing that seems to make it to the function is "This". I've noticed this with MessageBox and the send winsock function. So I guess it may be a const char* to char* problem but anyway the point is I have no clue whats going on and this has been bugging me. Below I left some code I was messing with. This is probably something simple that I'm missing but any help would be gratefully appreciated.

#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
    char MyString[255];
    scanf("%s",MyString);
    MessageBox(NULL,LPCSTR(MyString),"Test",MB_OK | MB_ICONINFORMATION);
    return 0;
}

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 
Questiondll linking Pin
rahul116730-Oct-09 6:31
rahul116730-Oct-09 6:31 
AnswerRe: dll linking Pin
Richard MacCutchan30-Oct-09 6:55
mveRichard MacCutchan30-Oct-09 6:55 
QuestionRe: dll linking Pin
David Crow30-Oct-09 7:42
David Crow30-Oct-09 7:42 
AnswerRe: dll linking Pin
rahul116730-Oct-09 20:26
rahul116730-Oct-09 20:26 
GeneralRe: dll linking Pin
Cedric Moonen30-Oct-09 23:25
Cedric Moonen30-Oct-09 23:25 
GeneralRe: dll linking Pin
David Crow2-Nov-09 3:35
David Crow2-Nov-09 3:35 
QuestionProblem while using CComBSTR Pin
Rahul Vaishnav30-Oct-09 5:37
Rahul Vaishnav30-Oct-09 5:37 
AnswerRe: Problem while using CComBSTR Pin
Rahul Vaishnav30-Oct-09 17:57
Rahul Vaishnav30-Oct-09 17:57 
QuestionJET / ADO - Windows 7 Pin
Robert Valentino30-Oct-09 4:55
Robert Valentino30-Oct-09 4:55 
QuestionBreadth First Search Algorithm in C Pin
mossy46430-Oct-09 4:50
mossy46430-Oct-09 4:50 
AnswerRe: Breadth First Search Algorithm in C Pin
Member 419459330-Oct-09 7:37
Member 419459330-Oct-09 7:37 

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.