Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Stye

@Stye
About
Posts
7
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • problem with if statement
    S Stye

    In an or test || if the first condition is true the second conditon is not even tested for, thus in your if ((str_Status != "Sent") || (str_Status != "Cancelled by User")) (str_Status != "Sent") is true so the if statement is executed. Just use (str_Status != "Cancelled by User") as the sole condition.

    C / C++ / MFC help

  • C++ Question.
    S Stye

    Doing it the way you have you have to press the enter key twice after getline to get a response (the bug you were referring to). See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q240015 for the fix ( the fix does work if you make the changes in the right file. The file referred to is in two different locations. You might as well change the code in both: MicrosoftVisualStudio\VC98\Include\String and MicrosoftVisualStudio\VC98\CRT\SRC\String I did and the enter key only has to be pressed once now and the code below which is like your way of doing it works fine. #include "stdafx.h" #include "string" #include "iostream" using namespace std ; int main(int argc, char* argv[]) { string s1; cout << "Enter a sentence:"; getline(cin,s1); if(s1 == "???" || s1 == "") cout << "First case"; else cout << "Second case"; return 0; }

    C / C++ / MFC question c++

  • C++ Question.
    S Stye

    I have 6.00 and works fine for me, try this out: #include "stdafx.h" #include "iostream.h" #include "string.h" int main(int argc, char* argv[]) { char line[100]; cout << "Type a line" << endl; cin.getline( line, 100); if(strcmp(line, "xxx") == 0) cout << "You entered xxx"; else cout << "You did not enter xxx"; return 0; }

    C / C++ / MFC question c++

  • C++ Question.
    S Stye

    Then simply use: cin.getline( line, 100) for the example given. The DEFAULT will be '\n' (carriage return) added as the final character when the return (enter) key is pressed.

    C / C++ / MFC question c++

  • C++ Question.
    S Stye

    Move the cin, e.g. char line[100]; cout << " Type a line terminated by 't'" << endl; cin.getline( line, 100, 't' ); cout << line;

    C / C++ / MFC question c++

  • Saving before close
    S Stye

    At some point use SetModifiedFlag(TRUE) and before closing have SaveModified() in the code.

    C / C++ / MFC question

  • Changing Dialog Font Programmatically
    S Stye

    Do you want to change the main dialog of a dialog based app or a dialog that is part of a doc view app? Do you want to change the dialog after it is already created or have a different font at creation depending a factor such as screen resolution, etc.?

    C / C++ / MFC help question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups