A question about C++ coding?
What you're looking for is an editor and a compiler. Generally, when the two are packaged together (usually with a debugger, as well), it's considered an IDE (Intergrated Development Environment). The more popular free IDEs are Visual C++ Express, Dev-C++, or Code::Blocks. The first of the three using Microsoft's C++ compiler, while the latter two use the MinGW port of GCC (G++). Avoid Turbo C++ if someone suggests it.
Question in C programming?
1) exclusive or. a ^= 0x20; 2) pretty easy, ask user for a string to print and the number of times to loop. If the string is equal to "q" or "Q", quit the program. If not make a for loop that loops "number" times, printing out the string. Repeat using a do while loop. EDIT: Sorry, thats what I get for answering before coffee. Thought he meant toggle the bit irrespective of its initial value.
Beginner, C++ PROGRAMMING HELP! 2 QUESTIONS! Coding provided...?
1 Code: The problem is in your #include section #include
It’s the ternary operator ( C Programming Tutorial ). It’s just a more concise way of writing an if-else statement. The following two code snippets are equivalent.if (x == 3) { x++;}else { x--;}x == 3 ? x++ : x--;Some programmers find it confusing to read, especially if the expressions get longer. The most accepted use is with variable assignment.x = isTrue() ? 4 : 5;It allows you to only write “x =” once instead of twice with the equivalent if-else.
I'll add a great resource that has recently launched: A community-driven list of C++ interview questions: Great C++ Interview Questions. Also, I found this slide extremely helpful while researching C++ interviewing on my own: Deep C. Good luck!
When people talk about C++ interview, usually it has two types: interview that focuses on the language itself and coding interview in C++. It's better for you to be clear about which one you are preparing for and I'll share some resources for both. It's not that common to have interviews that are mostly focused on the language, so I'll start from the coding interview in C++. In reality, the language doesn't really matter in this case and you don't need to remember all those syntax like STL functions either. What's more important is to have a solid foundation of data structures/algorithms that will help you solve those coding questions. Some recommended resources are:Coding interview questions and analysisLeetcodeGfgFor language interviews, nothing you can do but be really familiar with C++. The sad news is that C++ is one of the most difficult languages to be familiar since it has so many features and corner cases. Books like Effective C++: 55 Specific Ways to Improve Your Programs and Designs are highly recommended. It'll be even better if you can work on some projects with C++.