49,766 Topics
![]() | |
im curious as to if there is a benefit to the coder and/or reader in assigning a variable name in a class functions prototype...for example class book { private: //blah public: book( int, string, double); } vs. class book { private: //blah public: book( int data1, string name1, double data2); … | |
I'm trying to read this input from a text file but whenever I try to output it, it shows up as 00000. Input: IBM 100 93.2 98.6 MER 200 67.2 43.89 QQQ 300 78.9 70.0 C 200 35.78 50.02 CSCO 400 45.67 57.23 This is what I have so far: … | |
How can you do this in c++? | |
The program asks the user to provide from 1 to 6, inclusive, numbers between 1 and 59, inclusive, as their lotto numbers. The lotto program will then use the random number generator to provide the same number of numbers in the same range. Check to see how many of the … | |
I am working on a program that will scan the screen for a certain color. I made a code that will scan, but it is too slow. Is there anything else i can use instead of GetPixel()? Or is any other way I can speed this up. If it helps … | |
This is my basic set up as of right now for how my server will handle new connections to a listening socket. I created a simple console app to mimic a connecting client so I can do some testing. All works fine, and I can connect, but I debugged my … | |
I'm fourteen trying this on my own for the first time. Yes it is for my junior high math class. I am having a few issues.. I have cleared many of my issues up after I found I had left out a lot of {{ type things.. Any help would … | |
I am asking on multiple forums because I am desperate! Hi, firstly I would just like to say that I am not a C++ programmer and I never intend to be - I am an SQL, javascript and PHP developer. For a module at University I have to alter a … | |
Hey all! Homework help again...except this time not in the way you think lol...I finished all my problems and realized there's a problem in my makefile which I need in order to submit Here's the original make file that our professor gave us [CODE] CC = gcc JVC = javac … | |
This problem was from the book C++ Primer Plus Chapter 4 #8. The point of the code is to create a structure and use the new keyword to dynamically create a new structure. This problem makes me alter my code for the previous problem in the book so that I … | |
[CODE] #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main () { int numb, sum, divis3, divis5; numb = 20; sum = 0; double value = sqrt(numb); cout.setf(ios::fixed,ios::floatfield); cout << setw(8) << left << "NUMBER" << setw(8) << left << "DIVIS3" << setw(8) << left << "DIVIS5" << … | |
i have the next code that compiles without problems but when I run it after I put in the input data it gives me the next error: line 128 vector iterator not decrementable I use visual c++ 2010. [CODE] #include <iostream> #include <iomanip> #include <vector> #include <iterator> #include <algorithm> #include … | |
The basic structure of the program is this: 1. issue an interactive prompt for the user to enter a non-negative number, 2. verify that the input is indeed non-negative, or that the user wishes to end the program, 3. calculate the square root of the input value, using the method … | |
Hello, I took a C++ code from a colleague which uses OpenCV for image processing, and when I try to debug the program using Visual Studio 2008, as soon as the black output window pops up, I get the following error (Windows error, not code error): [B]"The program can't start … | |
With respect to the following code segment, what should be the n value in different classes, e.g., what is a.n, b[2].n, and c->n How to analyze them? [CODE]#include <iostream> using namespace std; class CDummy { public: static int n; CDummy(){ n++ ;}; ~CDummy(){ n--; }; }; int CDummy::n = 0; … | |
The Assignment is: Write a class named Car that has the following member variables: yearModel, make, speed. In addition the class should have the following constructor and the other member functions constructor-accept the cars year model make as arguments. an assign to the objects year, make also assign speed 0 … | |
The output of the vector that you helped me make is a little hard to read. Can you help me make it a little more readable like: Input: Enter number of different sizes: 5 and the inputs are : 35 x 2.36 23 x 1.23 12 x 4.23 16 x … | |
Here is my code: [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <cmath> #include <time.h> #include <assert.h> using namespace std; int main() { // = (num3&&num4) - (num1&&num2); // save this calc for later: hrIn + (hrOut/60.0); // same thing = num3 + (num4/60); // write an alogorithm to establish the … | |
I'm trying to create an array of my object I made, and basically the object doesn't have a default constructor, only a self made one. I've made my object array in the header file e.g. Object myObject[4];, however doing it this way requires for me to have a default constructor, … | |
My professor has working with very large number. We bring them into our project through a file stream (.txt). I get the MATH behind using 3 arrays to add, subtract, and store the sum of the numbers. I get that you can do a "x-'0'" to convert the char to … | |
well,this is my college assignment question.the question ask us to write a program that can compare 3 number,who is the biggest and smaller.the output should be like this: Enter 3 numbers. Number1: Number2: Number3: Main Menu 1)Find the biggest value among the 3 value you have enter juz now. 2)Find … | |
I don't know how to get the program to display properly any tips? Also would anyone guide me on how the logic works for deallocating all this memory please. [CODE]#include <iostream> #include <cstdlib> #include <windows.h> using namespace std; struct Entry { char name[23]; int age; Entry *next; }; // Prototype … | |
1) Write a function that merges two instances of the List ADT using the following specifications: MergeList (List list1, List list2, List& result) • list1 and list2 have been initialized and are sorted using function ComparedTo • result is a sorted list that contains all of the items a. Write … | |
So all i have to do is clean it up but cant find the source to the actual error. Heres my code: [code] #include <iostream> #include <fstream> #include <string> using namespace std; bool isVowel(char ch); string rotate(string pStr); string pigLatinString(string pStr); int main() { ifstream infile; string newstr; int length; … | |
i have this function that should compare values and return a string based on input from the main function. However it returns no value at all does anyone see and issue with it? have checked all the input it is getting the correct values highestMontName and averagedMonth are declared globally … | |
How do i get the loop to go back and prompt using for a valid number? #include<iostream> #include<conio.h> #include<iomanip> #include<string> using namespace std; int main () { string firstName; string lastName; int score1, score2, score3, score4, score5; float totalpoints; cout<<fixed<<showpoint<<setprecision(2); cout<<"Please enter the student first and last name: "; cin>>firstName>>lastName; … | |
I have a class that stores all of my variables and functions (for our purposes, DataClass), and a few different windows form classes that use the public variables and functions in DataClass. I need to keep the values of the public variables in DataClass until the program closes. I set … | |
What is wrong with my code? My fps time is not working.I found two errors in my code. Error 1 error C3861: 'install_timer_ex': identifier not found. Error 2 error C3861: 'textmode': identifier not found. [CODE]#include <allegro.h> BITMAP* buffer = create_bitmap(480,480); volatile int fps = 0; volatile int avg_fps = 0; … | |
Source: [CODE] #include<Windows.h> #include<conio.h> int main() { char stop = static_cast<char>(getch()); while (stop != 's') { // 'S' needs to be WIN+S keybd_event(VK_LWIN, 0x5b, 0, 0); // Press WIN KEY keybd_event(VK_LEFT, '0x25', 0, 0); // Press LEFT KEY keybd_event(VK_LEFT, '0x25', KEYEVENTF_KEYUP, 0); // Lift LEFT KEY } keybd_event(VK_LEFT, '0x25', KEYEVENTF_KEYUP, … | |
Hello, I have a program that uses getchar() and slightly confused and tried googling and it made it worse [ICODE] cout << ">What is the expected letter <<"\n>"; expectedLetter = getchar(); putchar(expectedLetterl); string exletter = expectedleter + post; cout <<">Do you wish to enter another letter (Y/y)/(N/n)\n>"; repeatIn = getchar(); … |
The End.