49,761 Topics
| |
Hello, I am working on a program for school and this is my first experience with arrays of objects. I am passing the array of objects into a function, and from within that function I am running another function that takes an individual object from the array as an arguemnt … | |
I am trying to make my program print out the contents of a vector containing objects of class type Checking i want it to print the balance of each element in the vector but when i try to use [CODE]cout<<checking[1][/CODE] all i get is nonsense characters here is what i … | |
Hi evreybody can anyone help me to solve this problem in introduction of algorithms ( Suppose program A has time complexity θ(f(n)) and program B has time complexity θ(g(n)) where f = o(g). What can you say about the real-world running time of program A versus program B?) plz im … | |
Just a few days ago I was working on a encrypting program that would take a character and convert it to the corresponding number. while working on it I found that you could input multiple letters and it would loop through all the letters and I can't figure out why … | |
Is it possible to create operator overloads for non-objects (like typedef-ed arrays)? | |
Greetings, I'm currently engulfing myself into game programming, and so far I've made a pretty stable library for a 2D-side scrolling shooter. Note that I'm not posting this in the game development due to my issue being more general than game-specific. What I'm experiencing trouble with, is upon deleting an … | |
hello this is my first C++ program my problem is that i cant find out to things frist is that when i rune it and sett the mathe type it is ignored laiter and hit shows alle offe the posbole mathe types ( that i have enterd +,-,/ and * … | |
Hi, after making some adjustmens to my code as recommended, I get those discard qualifiers errors.. [CODE] //pentathlete.h #include <iostream> using namespace std; template < class T > class pentathlete { protected : T comp_res [ 5 ] ; public : T sum_res ; pentathlete ( ) { for ( … | |
Hi, I've written a code to count vowels and consonants. But it hangs and doesn't do anything when a function call is made or even before that at get statement. When I try to get a string from user to pass to the function to count vowels or consonants. Here … | |
Ok, so ive had this really annoying problem with Visual C++. It bugs me because it doesnt make any logical sense. something i guess we need to program. Anyway, Visual C++ reckons that the datatype "string" isnt defined, even though it is in the included library string. If i right … | |
Hi, I need to write some code for an application that uses a camera with an gigabit ethernet connection. The company who made the camera has provided header files to read images from the camera. The files are : ImageLib.h , PvApi.h and PvRegIo.h. I wrote some code in Snap.cpp … | |
hello, I'm trying to install and use boost graph library file sin my code blocks IDE for C++ program but am unable to.Please help. | |
[CODE]#include <iostream> using namespace std; int main() { int sum = 0; // Declare an int variable sum to accumulate the numbers int lowerbound; // Set the initial sum to 0 int upperbound; // Sum from 1 to this upperbound // Prompt user for an upperbound cout << "Enter a … | |
Hello, I am trying to put finishing touches on a program I have been working on. I stopped messing with it awhile ago and decided to return and polish it a little. Oh yeah, I am trying to make it so when it returns the 5 long number (or word … | |
Hi, I need help finding the problem with my program. I believe everything is working but when I input the the tolerance, the program suddenly terminates. Please help me spot the problem. By the way, as a warning my program is very long but redundant. hehe. [CODE]#include <iostream> #include <string> … | |
How can you play videos in C++, I am quite willing to use more than less any headers, I basically need a code that will work like this: [CODE]#include "PlayVideos.h" int main(int argc, char *argv[]) { SDL_Surface *screen=SDL_SetVideoMode(WINWIDTH,WINHEIGHT,WINBPP,SDL_SWSURFACE); ShowVideo("MyVideo.avi",0,0,screen);//play a video at position 0,0 and apply it to the screen … | |
I have a data file which includes an employee name, hours worked, salary and age. I have to manipulate this data: Print out the data as it is read in. Compute overtime(over 40 hours) Compute tax paid per employee using a specific formula. Sort the list by name. And a … | |
[CODE]#include <iostream> #include <string> // Declare the BaseClass. class BaseClass { public: // Constructor. BaseClass(); // Destructor. ~BaseClass(); // Simple method. void doSomething(); }; // Declare a SubClass that // inherits BaseClass. class SubClass : public BaseClass { public: // Constructor. SubClass(); // Destructor. ~SubClass(); }; // Define the functions. … | |
I'm having trouble overloading the operator< for a class that I want to use as a key for an stl map. It works fine for a comparison test, but when I try to use the std::map.find() function I get an error: [I]binary '<' : no operator found which takes a … | |
Hello guys I have been staring at this code for an hour and cant get it to work. My for loop on the bottom is not working. For some reason the array values keep resetting (value[row][col1]. This supposed to be Gauss-Seidel method so basically its an iterative method that relies … | |
I'm having an issue with my program when I call the "drawCardFace" and "drawCardSuit" functions. The function calculates and gives one answer the first time I call it. And then uses that same answer the next 4 times I call it. Can someone explain what I need to do to … | |
Hi all, First-time poster and netadmin/infosec guy trying to get into coding. My company uses a SQL Server 2005 database to store customer information and the like, and I'm hoping to learn to interact with it programmatically so I can write and/or customize software to make life a bit easier … | |
Hey everyone! I was recently assigned this program in class and have finished it but i have some compiler errors i cant fix. I was just hoping that some of you could give it a shot and share what kind of code you came up with. Well here it is … | |
I am testing a program in C++ Templates (from the Deitel Textook) and I have the typical three files: Array.h: [CODE]// Exercise 14.7 Solution: Array.h // Class template Array definition. #ifndef ARRAY1_H #define ARRAY1_H #include <iostream> using namespace std; template < typename elementType, int numberOfElements > class Array { public: … | |
i want to apply a technique of sorting the numbers using binary search tree . Average case of building a tree is O(lg n) and then if i apply Inorder traversal , i could get sorted output. So, can this technique be used over others like mergesort , quicksort etc. … | |
I have this Code written but I am having problems with the While loop I need it to recognize if the password has less then 5 characters and if there are spaces. I just cannot get it working for the spaces. Can anyone help?? [CODE]#include <iostream> #include <vector> #include <string> … | |
Hello, I need to random generate some values in c++. I know that I can use rand() but I need to generate values with the following condition: the generated values must be equal to 2^n (0, 2, 4, 8, ...). Is that possible? Kind regards, M. | |
ok my getData() function reads a text file and stores it into an array called info, and everytime it reads a letter from that file it calls a member called addRear which comes from my link list class "slist". what i need help on is how could i display this … | |
I was reading through the SIP documentation and was confused on a few things. I can't figure out what code to implement to open a transaction between a server and client. What IP address and port and what encoding should I use (for a video server). Thanks for any help. |
The End.