49,761 Topics
| |
[code] #include <iostream> #include <list> #include <string> using namespace std; // prototype for function template printList template < typename T > void printList( const std::list< T > &listRef ); class NumberOfPersons { private: int numberOfPersons; public: NumberOfPersons(int person); int getNumberOfPersons(); }; NumberOfPersons::NumberOfPersons(int person) { numberOfPersons = person; } int NumberOfPersons::getNumberOfPersons() … | |
I have ubuntu installed on my computer upstairs and gtkmm works just fine on it but i cant figure out how to get it to work on windows. I was wondering first if there was a clearer tutorial than then the one on the gtkmm site. I downloaded [URL="http://gladewin32.sourceforge.net/"]Glade/Gtk+ for … | |
Hello, I am having problem with my do...while loop. It asks for student identifier twice before proceeding. I tried moving the "do" after the program prompts the user for his choice of id, but I couldn't get the loop to terminate after that. Any tips will be appreciated. Thank you! … | |
Ok, I know you aren't suppose to (or can't) do comparions on arrays such as, if (x < y), when both x and y are single dimensional arrays. But what about if you have a string and want to compare one element in that string. For example, I am trying … | |
:icon_question: [COLOR="Green"][B][I][/I][/B][/COLOR]how can we display the elements of a linked list? | |
Hello ladies and gents, It's been ages since I posted here, have been doing some coding on and of and I was wondering about the following, beneath is a test I made in trying to use the new operator in combination with a string, first a string literal, second time … | |
Ok so my first thread got deleted, due to spam. However, I still need help with my program. So here's my program description. [B]Electronic submission: You are to electronically submit your assignment through Moodle at clasess.cs.siue.edu. Objectives: Loops and decisions. Problem Description Write a program to simulate a game of … | |
Okay, so I'm trying to write my own little version of Tic-Tac-Toe - and YES, I did use the search function and I saw the billions of threads involving Tictac toe. HOWEVER, I am not looking for code written for me already, I don't want to be lazy I want … | |
Hey guys, First time poster here.:) Just started my C++ career and am working with pointers/arrays at them moment. I was wondering why I cannot take a user input ('n') to create the size of the array "y". Can anyone show me why this syntax is wrong? Thanks for the … | |
OK, as you can probably tell from my code, I am trying to design a program that will keep requesting a password until the right password is entered (using a Do While Loop with char instead of int). this is my code: (this is one of my first solo pieces … | |
:) hi all. Please help me .... Currently im working wid a bank project in .net....... !!! so please reply me wid .. the basic thing that are needed for developing a project like that. please reply me .... !!! give me sugestions ... regarding the different acount types how … | |
:) hi all, please help me... perhps im using djgpp for my cpp projects ... i cannt able to use the dos.h functions such as the delay(); if anybdy knw about how to use it please reply me ...!!! | |
in the function "deal", I want to call the function "add", but it doesn't work .... any suggestions? [code] #include "DeckOfCards.h" int DeckOfCards::deal() { int y,z; int y1,y2; char x1,x2; char cards[13]={'A','2','3','4','5','6','7','8','9','0','J','Q','K'}; char deck [260] ; for (int i=0; i< 260; i++) deck[i] = cards [i % 13]; y = … | |
Could somone give me a hint as to why my division by 0 check doesn't work? [code]istream & operator >> ( istream & is , Rational & r ) { char x ; is >> r.num >> x >> r.den ; if ( r.den == '0' ) { cout << … | |
Okay, So i'm close to finishing up my program. I just need a few more things. By the way, all of you are AMAZINGLY great. I appreciate all the help. Alright... My program outputs Names, their Bowling scores, and How many points they have received (the points still need to … | |
How do I get the text out of a listview in report style into an array? I want it to be something like this: [[item1],[subitem1]],[[item1],[subitem1]],[[item1],[subitem1]], Here is some of my code: [CODE] hWndListView = CreateWindowEx( 0L, WC_LISTVIEW, "", WS_VISIBLE | WS_CHILD | LVS_REPORT, 0, 21, 340, 190, hWnd, (HMENU) ID_LISTVIEW, … | |
hi, i would like to convert a string into an array. ex. string = "i love c++"; array[1] = "i"; array[2] = "love"; array[3] = "c++"; can somebody help me pls? thanks alot | |
I'm almost finished with this program. All i need to do is fix up the points system. Right now I have it where it numbers everything, which i'm using as the points system. take a look [CODE=C++] #include <iostream> #include <string> #include <istream> #include <fstream> using namespace std; int main() … | |
Can I get my output in my program to be sent to another program like Wordpad or Microsoft word? | |
hii,I'm a new programer.. and now I have a homework. And I stuck with this,, This homework about find 100 first number.. I have one solution but,this solution is using syntax goto().. and the problem is my homework is restricted using syntax goto()..this my first solution #include<conio.h> #include<stdio.h> #include<stdlib> main() … | |
Take a look at the "points" section. It says that i haven't declared the string name for "scores"... but scores is an int name not a string. Whats going on? #include <iostream> #include <string> using namespace std; int main() { const int MAX=4; std::string names1[4] = {"Anna" , "Jenny", "George" … | |
how can calculate the memory address of lower triangular array such this one : 20 7 5 60 8 0 10 0 0 0 0 0 ineed just the formula 2calculate just the upper traingular and cancel the zero i tried 2use svd ( singal value decomposition) but i really … | |
Everything compiles no warnings or errors, but after I run this I get a core dump if I uncomment "delete [] a;" at the end of the main() function. It seems to run correctly if I leave "delete [] a;" commented out? Any suggestions will be appreciated. [code=C++] #include <iostream> … | |
this is the final version of the priority queue i implemented {with some of your help!}... the problem is that when i profile the code with valgrind, it shows that i have a memory leak.... i can also see that, if in my code i make certain test_points{where i pause … | |
How to calculate time complexity of the following piece of code?? [code] assume n= 2^k i=n; while (i>=1) { j=i; while(j <= n) { <body>> // Needs theta(1) j=2*j; } i=i/2; } [/code] | |
Hello, I need to complete a selection sort (descending order) on a string that contains 3 letters and one number. This is the function I wrote so far, but it doesn't sort properly. It is sorting, but I can't figure out its scheme. Any tips? Thanks! (The arrays are parallel. … | |
hi everyone I wanna to ask about calculation of 2-D array address I remember that equation that can do this for an array, char a[R][C]; Address of an element a[N][M]; = baseAddress + elementSize * (N*C+ M); Is it right?? :) Other thing, is it deferent if the array is … | |
hey guys. the following code should return a percentage of the current values of the object. I keep getting 0 returned. If this isn't enough code let me know. [code]Money test = ourAmount.percent ( 10 ) ; test.output ( ) ;[/code][code]const Money Money::percent ( int percentFigure ) { return ( … | |
what book will i use for internet opening and function with using visual c++ 6.0 compiler please help me gidos | |
Can anyone suggest an algorithm or function to generate combinations/ permutations of a group of substrings stored in a vector. The substrings consists of 3 letters and the resulting string combinations should be of a size that is a multiple of 3. |
The End.