Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
CEdit* pEdit1 = (CEdit*)GetDlgItem(IDC_EDIT1); //ID's werden übergeben?!
CEdit* pEdit2 = (CEdit*)GetDlgItem(IDC_EDIT2);
CEdit* pEdit3 = (CEdit*)GetDlgItem(IDC_EDIT3);
CString str;
pEdit1->GetWindowText(str);
pEdit3->GetWindowText(str);
int iZahl = atoi(str);
[B] int dername;
dername = peterpan;[/B]
if (iZahl >= 18)
str.Format(_T("Hi [B]%i [/B]!Du bist %i alt und darfst diesen Film sehen."), [B]dername[/B],iZahl);
....usw
#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
int main()
{
char xname;
printf("Wie ist dein Name?");
scanf("%s", &xname);
printf ("Dein Name ist %s", xname);
getchar(); // Sorgt dafür, dass sich das Fenster nicht sofort schließt.
}
Da nimmt er aber nur den ersten Buchstaben:siehe "cin"
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
char xname;
cout << "Gib dein Name ein:";
xname = cin.get();
cout << "Du hast eingegeben: "<< xname <<"\n";
cout << "lalalla";
xname = cin.get();
system("PAUSE");
}
#include <iostream>
using namespace std;
int main()
{
string eingabe;
cout << "Gib was ein: ";
cin >> eingabe;
cout << "Du hast " << eingabe << " eingegeben." << endl;
return 0;
}
In einen char passt ja auch nur ein Zeichen rein, sagt ja der Name schon. Wenn du eine Zeichenkette einlesen willst muss der Datentyp std::string sein.
In C++ z.B.:
Code:#include <iostream> using namespace std; int main() { string eingabe; cout << "Gib was ein: "; cin >> eingabe; cout << "Du hast " << eingabe << " eingegeben." << endl; return 0; }
Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) c:\.........\projects\testios\testios\testios.cpp 13 testios
bjoern[~]$ g++ test.cpp -o test && chmod +x ./test && ./test
Gib was ein: foo
Du hast foo eingegeben.