49,758 Topics
| |
This is my first time to try using STL maps. The code looks correct as far as I can tell, but when I try to compile a test file that does nothing but include the header for the class and declare a variable of that class, I am getting compiler … | |
This code is supposed to find the nth prime number (n being input by the user). I have the code to calculate whether a number is prime or not, but I don't know how to get the code to display the nth prime number. #include <iostream> using namespace std; void … | |
Can anyone help me make a code or advice I need a code that takes 2 parameters eg. integer 123 and base number from 2 to 16. Using argv[1] and argv[2] any help greatly aprreicated | |
Hi, I am quite new to C++, Currently, I'm learning how to do a problem which will take a text file of thousand most common words in the english dicatonary with another text file. After finding how many words are in said text file show the percentage of which are … | |
I have searched for and read through over 50 examples of linked lists. I can barely make heads or tails out of them. Some are in C, some are in Java, some use templates, most only discuss theory and display flowcharts but have few explained examples. I need serious help! … | |
Hi there just doing some work where i need to produce a database in C++ for DVD now I have done most of it but I’m stuck on some bits. I have split the database up into different files but I will post the files which are important. I just … | |
| I have pretty much failed my class (4 weeks behind in an 8 week class that is currenlty at the beginning of week 8), but I am wanting to learn C++ for myself anyhow. I have visited http://www.cplusplus.com/doc/tutorial/ and gone through the tutorial, but cannot understand this assignment. I have … |
Hi guys, I'm programming a firewall and so far I have complete the driver coding, but I don't know **How to send IRPs from user applicatio to the dirver?** I have used `IoCreateSymbolicLink` to establish the connection between the usermode and kernelmode but I don't know how to send information … | |
Hello, I have been reading an article on comparing data, and have been given this code: for(i = 0; i < matrix1W; i++) { for(j = 0; j < matrix2H; j++) { diffSum += abs(matrix2->pData[(row+j)*backW+(col+i)] - marix1->pData[j*matrix2+i]); } } Now it works when using arrays, but, I'm using vectors, is … | |
Hello! I want to ask you guys if anyone can help me correct my current program to read graph from a file instead of adding manual matrix in program. Example graph: graph.txt 8 1 2 3 1 3 6 1 8 1 2 3 2 2 8 2 3 4 … | |
#include <iostream> using namespace std; class test { public: int bla(int &c); }; int test:: bla(int &c) { c=100; return c; } int main() { int c=10; test student; int b=1; switch(b) { case '1': cout<<student.bla(c); break; } cout<<c; return 0; } I would like to change the variable c … | |
Is there any standard function in gcc that is equivalent to getch() so that I can read the input without hitting enter key? | |
hi i am trying to change an input from upper case to lowercase.I am not getting it right.When i key in say Liverpool or TIGERS it only show l and t respectively. Need assistance #include <iostream> #include <cctype> #include<iostream> using namespace std; int main() { char s; cout<<"Name your favourite … | |
I again have a C code that i need in c++ #include <stdio.h> void hexDump (char *desc, void *addr, int len) { int i; unsigned char buff[999]; unsigned char *pc = addr; // Output description if given. if (desc != NULL) printf ("%s:\n", desc); // Process every byte in the … | |
I wrote about this the other day but do not think I explained it too clearly...I shall try again... So my problem is this...when I am trying to allocate memory to a pointer, it fails. This is my MatrixClass definition.. class MatrixClass { public: MatrixClass(int m, int n); MatrixClass(void); virtual … | |
I am having trouble with this part of my program assignment. I have created and compiled the three separate implementation files that design the three classes, they each have a default constructor, overloaded constructor, and a display function. //************************************************************************************************************ "When your program is working correctly, define an array of pointers … | |
I'm having a problem getting the number of integers greater than the average in my array to display. I keep getting "You have 1 number greater than the average when there are 5 that are greater. Pls help!!! This is the code I've devolped so far: #include <iostream> using namespace … | |
So im learning SDL to get an idea on game programming for my career as a game developer. I havent done any learning for a couple of months after getting stuck on this problem. So im using a lazyfoo.net tutorial engine. that moves a player and has a collision with … | |
If someone can simplify this code I will appretiate since I don;t have time... !!!! Thank you in advance..!! Regards..!!! CODE::: #include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> #include <stdio.h> #include <stdlib.h> using namespace std; int DisplayMenu(); //function that display the menu of the program int Quit(); //quit function … | |
In my code below you will see at the bottom my very lame attempt at sorting the vector array of employee records by name, alphabetically. My friend tried to tell me how I'm supposed to do it, but I can't make any sense of it really, so if someone could … | |
I am trying to use the size of an array to determine how many entrys are in the array as follows sizeof(array)/sizeof(array type) = number of elements in the array. I then wish to use this to add more data to the array as follows array[sizeof(array)/sizeof(array type)] = new Object(object … | |
I'm trying to write a program that uses vector to store the grades for the number of students entered.But i seem to be getting some problems with my code. I am able to enter the number of students, but when it asks for the grades, the program exits. I hope … | |
Please delete this...I'm new to the new Daniweb format. | |
Hi everybody, Please excuse the noob question as I am new to STL in C++. I am trying to write a very basic program which uses iota. However my compiler is complaining that iota does not exist in algorithm. Some other forums suggested including <backward/algo.h> as iota could have been … | |
Define a base class person that will contain universal information, including name, address, birth date, gender and identification (student, worker etc). Derive from this class the following classes: Student Worker Student_worker Add variable school to student and company to worker class. Write a program that asks user to input information … | |
hi everyone!!! I am trying to write a code for list of names to be sorted in alphabetical order. can anybody please tell me what I am doing wrong. and one more thing , is it possible to bubble sort a names in unspecified number of entries? and if it … | |
I have to create a program that will prompt a user radius and keep adding them until user says no. Then, the program gotta able to hold those numbers and calculate two things: Surface area and Volume. The program also gotta able to Sort the numbers by its volume(low to … | |
#include<iostream> using namespace std; #include<string> #define INT_MAX 100000 #define INT_MIN 0 using namespace std; class Automobile { public: Automobile(); void read(); bool is_cheaper_than(??????) const; bool better_mileage_than(???????) const; bool better_finanace_than(??????) const; void print() const; private: string name; float price; float mileage; float finance; }; Automobile::Automobile() { name=" "; price=INT_MIN; mileage=INT_MAX; } … | |
I'm getting an error with this code. Both the findMax and findMin lines in main say "Invalid conversion from 'int' to 'int*'". What does it mean? #include <iostream> using namespace std; int findMax(int[],int); int findMin(int[],int); int main () { int max, min, x; findMax(max,x); findMin(min,x); return 0; } int findMax(int … |
The End.