Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am a beginner at programming, so this might be a dumb question, but here it is...
I've been going through books, learning languages such as C and C++, and I have a basic understanding of the code. Yet, is this type of code used in actual programs? For example, I open a program on my computer, and there is a nice looking user interface on it. When I code programs at home, my user interface is the command line. But when I go to code a program with a GUI, the code I learn in books doesn't even apply to the GUI code.
So I guess I'm wondering - How does the code and things you learn in books apply to actual programs with a user interface? And is the code used for console applications even used anymore?
Any guidance or help would be appreciated!
Thanks
Ian Vaughn
Yes and yes.
GUI's are sometimes programmed in C++ (C is rarer), but it's also used for console programs. One special type of GUI's is in fact usually done in C++, and that's games. A common example of console programs is a converter program, which takes in one file and creates another. It's UI can be ./tool < InFile > OutFile.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 11 months ago.
Improve this question
So I am writing code for a microcontroller (using Arduino IDE), which I do not have a ton of experience doing. This question popped into my head when I was wondering which 'parts' of C++ I could use in my code that would flash onto this NRF52840 microcontroller. Basically, I am wondering: What on that board determines the code I must write for it?
I understand saying "what code can I write/not write" is broad, but its because I dont know what to say instead. A few guesses I have for substitutes for this would be: certain libraries? certain coding languages?, certain types of languages (interpreted vs compiled)?
Sorry if this question is too horribly stated to get an answer, but this was legit the best I could do lol.
In the case of using C++, it depends entirely upon what language features the compiler you are using supports. I suppose there might be hardware out there that is so simplistic that certain features are simply beyond the ability to implement, but I cannot tell you either what hardware that is, or what language features would be so effected.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Let's say we've got a first program called Program1.exe which contains the necessary information to create and compile another application called Program2.exe. Actually it could also load that information from a txt file or whatever.
Googling, I've found that this is "easy" to do in C#, using Visual Studio:
How to programatically build and compile another c# project from the current project
Programmatically Invoke the C# Compiler
The problem is that I'm not using (and can't use) C#, but C++. Summing it up, my question is if that I can do this same thing using C++.
I would prefer to do it without additional libraries, but if that's not possible, or if it's too hard to do, you can also recommend any library allowing it.
I think you'll probably have noticed it, but my goal is to use it under Windows so I don't care if it's not portable.
Thanks everybody.
It's trivial (if maybe a bit odd) for a C++ program to compile and run another based on code stored in a text file. Debugging that other program, however, isn't.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have some very specific questions about writing operating systems that I was hoping could get answered:
How much assembly code would I need to write to load a minimal C Kernel if I use GRUB as a boot loader?
My kernel will be written in C, It will load a command line shell that I wrote in C++, it does not make any API calls only standard library calls, will I need to rewrite the entire C++ Standard library to do so?
Can I write video, keyboard and floppy drivers in C++?
Do GCC and G++ output 16 bit real mode code?
Can I write this all using Mingw on Windows or will I have to write it on Linux?
Do I need to be in real mode in order to write directly to the video memory?
If anyone can answer my questions I will be very thankful
1: You should only need a small amount of assembly to handle the boot process and load the C code. Shouldn't be more than like 20-30 lines I think.
2-4: I haven't really used C++ with OS dev, but I think I remember reading that it takes more work to get it running somewhere. Sorry I can't be of more help.
5: You "can" do it using MinGW, but from my experience it mostly complicates things. I could never really get a Windows environment working, but I also gave up without too much effort.
EDIT: Here is a link to some example assembly. This is all I ever had to use:
http://www.jamesmolloy.co.uk/tutorial_html/2.-Genesis.html
The rest of that site is a pretty good tutorial too if you are at all interested in that kind of thing.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am given a task to develop an C++ command-line(terminal, I am using, will run the program in Linux/Ubuntu) display. But I dont like the command-line design, is there anyway to improve the UI design?
Note: I must run the program in terminal!!
ncurses. It's a lib to be able to put text wherever you want in the terminal, so you can effectively draw, ascii-art style in the terminal. It's also a very old library, so it may be a little tedious to use.
I developed a simple multiplatform console management library some time ago.
You can use it at least on Linux and Windows. It uses native calls in Windows, and standard escape codes in other platforms.
If you just want to show some colors, position the cursor, and so on, you can use it in a matter of minutes without struggling with ncurses.
The documentation (generated with doxygen) is included in the Zip file.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I really want to learn more about C++. I know the basics, and I know the concepts, and I have even been able to create C++ projects myself, but my problem is being able to view, fix, and add to code I haven't written myself. I have looked at some open source projects on sourceforge, etc, but many of them are so big or there are soooo many projects available until I don't know what to do.
Are there any "small or simple" projects or tasks in C++ that will allow me to extend my knowledge of C++ by use of hands on experience?
If you are already able to create own projects, I think the best way to learn how to read&change someone's code is to get job in software company. They even will pay for it :)
Creating your own client / server application using socket programming is a big and fun area in programming which you should check out.
http://subjects.ee.unsw.edu.au/tele3118/wk6_sockets.pdf
...but my problem is being able to
view, fix, and add to code I haven't
written myself.
That is tough even for experienced programmers.
A book that might help you is Code Reading: The Open Source Perspective by Diomidis Spinellis.
Read The Art of Unix Programming ( TAOUP ). Its available online, well written and has lots of case studies that represent well designed programs. You may also find some good C++ opensource software amongst those case studies.
Apart from TAOUP, take a look at Boost C++ Libraries. They provide peer reviewed source libraries that are very well documented.
Another one, I have heard is Postfix ( an Open source email server for Unix ) that is said to have well written C++ code. Though, I must admit I do not have any direct experience with it.
Hope this helps :)