586 Answered Questions for the topic C++

C++ Logic

03/19/19

C++ interview preparation?

I have a Phone interview coming up next with with a company which works in financial software industry. The interview is mainly going to be in C++ and problem solving and logic. Please tell me the... more
C++

03/19/19

What is runtime polymorphism in C++?

C++

03/18/19

Single quotes vs. double quotes in C or C++?

When should I use single quotes and double quotes in C or C++ programming?

03/18/19

What happens when you logical not a float?

I assume this just returns an int. Is there anything else going on I should be aware of? C/C++ differences? float a = 2.5; !a; // What does this return? Int? Float?
C++ C Linux Api

03/18/19

What is Linux’s native GUI API?

I hope this doesn’t come across as a stupid question but it’s always something I have wondered. Both Windows (Win32 API) and OS X (Cocoa) have their own APIs to handle windows, events and other OS... more
C++

03/18/19

Why use pointers?

I know this is a really basic question, but I've just started with some basic C++ programming after coding a few projects with high-level languages. Basically I have three questions: 1. Why use... more
C++

02/14/19

Problem solving process

Draw a Problem Analysis Chart (PAC), Interactivity chart ,IPO chart, Algorithmand flowchart for the following problems1. A painter wants to know the amount of paint needed to paint only the walls... more

02/01/19

C++ changing the char of Vector <string>

void encodeUpper (vector <string> &book, int &cipher){ string word; char asciiNum; for(int i=0;i<book.size();i++){ if... more
C++

10/23/18

what is the code?

A bus line has busses with 30 gallon tanks. that it uses to travel to different cities. The company needs you to write a c++ program that will allow the clerk to input the roundtrip mileage to and... more

tricky c++ if else question

Why will it print the bold statements? what about Hi-5 " #include <iostream>using namespace std;int main (){ if ((4 < 2 ) && (3 == 3)) cout << "Hi-2 "; else if (3==3) cout... more

if else confusing problem?

In this program no matter how many times i run it it wont print out the statement in bold. shouldnt it print evert statement after else? it will only print "HI-6"     #include... more

07/31/18

Write a C++ if statement

Write a C++ if statement that displays the message “The score is invalid.” if the variable score is outside the range 0 through 100.*Assume the variable score has already been declared and... more

07/31/18

Convert the following C++ code statements to the equivalent C++ for loop code statements

14. Convert the following C++ code statements to the equivalent C++ for loop code statements:int count = 10;while (count <= 100){cout << "The count is " << count << endl;count++;} more
C++

06/10/18

C++ rearranging

Fill in the blanks to declare a class "test" with a "foo()" public member function. Declare a pointer "myPtr" to "test" and call "foo()" via the pointer.class test{_____ :void foo() { }};_____... more
C++

06/10/18

C++ rearranging

Rearrange the code to declare a file object and an associated file ''myfile.txt''. Write ''I can work with files'' to the file if the file is open. Otherwise, print ''Something went wrong'' to the... more

04/15/18

C++ programming

How to write a C++ program that requests an integer value from the user. If the value is between 1 and 100 inclusive, print “OK;” otherwise, print “Out of range.”

If you declare an integer pointer as int *pt; and you declare an integer variable as int num; , then which of the following is legal?

A. num = &pt; B. pt = # C. *num = *pt; D. &num = pt; Please do not mention C. 
C++

02/20/18

If you declare an integer pointer as int *pt; and you declare an integer variable as int num; , then which of the following is legal?

A. num = &pt; B. pt = # C. *num = *pt; D. &num = pt;
C++

02/20/18

If you want to store an integer array named list at memory location 2000, you make the statement _____.

A. int list[] = 2000; B. &list[] = 2000; C. 2000 = &int list[0]; D. You cannot locate an array at a specific address like 2000.

Char tic tac toe

char tic_tac_toe(char board[][3]): Given the configuration of atic-tac-toe board, return the winner (‘x’ if ‘x’ wins, ‘o’ if ‘o’ wins, and ‘d’ if it’s a draw ).

Size of array

void copy(int a[], int b[], int n): Make a copy of a givenarray a of size n into b. Assume that the size of array b is the same as a and the memory for array b has been allocated.

arrays question

int sorted(int a[], int n): Test if a given array a of size n is sortedin ascending order.
C++

09/06/17

Array question

int sum(int a[], int n): Return the sum of the elements in a given array a of size n.
C++

06/16/17

I have assignment for passing array to function! can help?

Passing array to function!

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.