Analogy to console applications - Bücher,C undC#TrainingsfürProgrammierer c schulungen, C# Schulungen, Bücher über...

|
Bücher,C undC#TrainingsfürProgrammierer c schulungen, C# Schulungen, Bücher über c mit Visual Studio
|
bet | 8/8 | Sana | 20.02.2024 | Hajmi | 1,28 Mb. | | #159175 |
Bog'liq www rkaiser de c-winforms-tutorial 6. Analogy to console applications
Comparing of this Windows Forms project with a corresponding console application shows the analogy of the two types of projects. This analogy shows how to convert a console application into a forms application: If you have a console program like
#include int main() { int n; std::cin >> n; int result = plus_2(n);
std::cout << "plus_2(" << n << ") = " << result << std::endl; return 0;
}
you can port it to a form application with relatively little effort. You just need to replace the I/O statements and call the functions in response to a ButtonClick, etc:
private: System::Void
button_plus_1_Click(System::Object^ sender,
System::EventArgs^ e)
{
int n = Convert::ToInt32(in_textBox->Text); int result = plus_1(n);
out_textBox->AppendText(String::Format("plus_1({0})=
{1}\r\n",n,result));
}
Excerpt from the preface to my book
„C++ mit Visual Studio 2019 und
Windows Forms-Anwendungen“
The preface to my book (in German)
teaches C with Windows Forms applications in more detail.
Preface
The starting point for this book was the desire for a C textbook in which programs for a graphical user interface Windows) are developed from the beginning, and not console applications as is usually the case. Programs in which inputs and outputs are done via a console are like stone-aged DOS programs for many beginners and discourage them from wanting to deal with C at all.
Windows Forms applications are an ideal framework for C programs with an attractive user interface: access to Windows controls Buttons, TextBoxes etc.) is easy. The difference to a standard C program is mostly only that inputs and outputs are done via a Windows control (mostly a TextBox) textBox1 AppendText(„Hello World“); while in standard C the console is used with cout: cout << "Hello world" << endl;
But not only students can benefit from C with a graphical user interface. With Windows Forms projects, existing C or C programs can be enhanced with a graphical user interface without much effort. And those who know C or C and do not want to learn a new language for a GUI can make their existing programs more beautiful and easier to use with simple means.
C has developed rapidly in recent years: The innovations of C 11, C 14, C17 and C20 have brought many improvements and new possibilities. Much of what was good and recommended in 2010 can be made better and safer today.
As a book author and trainer who has accompanied this whole evolution, you notice this particularly clearly: many things that have been written in the past should be done differently today. True, it would still be compiled. But it is no longer modern C, which corresponds to the current state of the art and uses all the advantages.
This book introduces C at the Visual Studio 2019 level in May 2020. This is the scope of C17.
Bücher,C undC#
Trainingsfür
Programmierer
|
About
Contact
Impressum
|
Privacy
Privacy Policy
Terms and Conditions
|
Social
Facebook
Instagram
|
Contact Us Twitter/X
C Schulungen, C#
Schulungen, Bücher über
C mit Visual Studio
Designed withWordPress
|
| |