49,758 Topics

Member Avatar for
Member Avatar for adeel381
Member Avatar for bgx90

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 …

Member Avatar for bgx90
0
3K
Member Avatar for FraidaL

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 …

Member Avatar for WaltP
0
1K
Member Avatar for pokie_da_codie

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

Member Avatar for WaltP
0
79
Member Avatar for padraga

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 …

0
108
Member Avatar for Nathaniel10

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! …

Member Avatar for Nathaniel10
0
294
Member Avatar for Farmlord

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 …

0
44
Member Avatar for Griff0527

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 …

Member Avatar for Lerner
0
2K
Member Avatar for Rasool Ahmed

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 …

Member Avatar for nullptr
0
915
Member Avatar for phorce

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 …

0
254
Member Avatar for minghags

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 …

Member Avatar for minghags
0
258
Member Avatar for Sunshine2011

#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 …

Member Avatar for mitrmkar
0
130
Member Avatar for niyasc

Is there any standard function in gcc that is equivalent to getch() so that I can read the input without hitting enter key?

Member Avatar for jaybhanderi
0
7K
Member Avatar for Valiantangel

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 …

Member Avatar for triumphost
0
93
Member Avatar for MasterHacker110

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 …

Member Avatar for BobS0327
0
1K
Member Avatar for james6754

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 …

Member Avatar for Lerner
0
259
Member Avatar for justinfritz

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 …

Member Avatar for Saith
0
312
Member Avatar for jiggaman77777

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 …

Member Avatar for ravenous
0
2K
Member Avatar for ChrisMackle

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 …

Member Avatar for sfuo
0
505
Member Avatar for poolet

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 …

Member Avatar for poolet
0
237
Member Avatar for caltech

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 …

Member Avatar for caltech
0
274
Member Avatar for benclifford

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 …

Member Avatar for triumphost
0
558
Member Avatar for ashboi

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 …

Member Avatar for ashboi
0
2K
Member Avatar for gerard4143
Member Avatar for abhimanipal

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 …

Member Avatar for mike_2000_17
0
2K
Member Avatar for c++bob1234

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 …

Member Avatar for c++bob1234
0
122
Member Avatar for dariaveltman

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 …

Member Avatar for Lerner
0
247
Member Avatar for pclovechristian

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 …

Member Avatar for Lerner
0
133
Member Avatar for c++bob1234

#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; } …

Member Avatar for Saith
0
297
Member Avatar for FraidaL

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 …

Member Avatar for Saith
0
253

The End.