- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 18
- Posts with Upvotes
- 17
- Upvoting Members
- 16
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
99 Posted Topics
Re: [QUOTE=blackrainbowhun;1680325]Hello everybody! I'm participating in a competition, and I just finished my program. It doesn't really matter what it does, and how. I have encountered a bug I think. I'd appreciate every kind of help, because with the problem, my solution fails for the test file. I have to read … | |
Re: [QUOTE=annette123;1702132]I am struggling to write the push and pop functions for a stack of arrays. I know how to write the code to push single items unto a stack and pop them out. Some have suggested that I use an array of arrays (two-dimensional array) to load the array of … | |
Re: [QUOTE=phorce;1702741]Hello, I have a map that contains the alphabet (key) and a double (value) and I would like to sort the list so that the highest value is at the top but it still keeps it's key.. E.g. [code] #include <iostream> #include <map> int main() { map<char, double> alphabet; alphabet['a'] … | |
Re: [QUOTE=libathos;1700584]I'm writing a project in xlib and have a problem concerning the colors.I use unsigned long type variables for storing the color values.does anybody know how can i take the red green and blue values of each color?[/QUOTE] Are you saying that the 24 bits of color (8 for each … | |
Re: [QUOTE=lolwut25;1700859]I have an assignment where I have to write a program to prompt the user for a file name and location (it is a text file), once the user has entered that, a menu pops up and gives the user 4 options and asks which one they would like to … | |
Re: [QUOTE=Nikesh2014;1699405][CODE]#include<conio.h> #include<stdio.h> #include<iostream.h> #include<process.h> #include<dos.h> #include<time.h> #include<fstream.h> #include<string.h> class getInfo { int dep; int with; int bal; int year; int mon; int day; char des[100]; public: getInfo() { dep =0; with =0; bal =0; year =0; mon =0; day =0; strcpy(des,""); } int year1() { return year; } int month1() … | |
Re: [QUOTE=WaltP;1696939]Nope. [B]i[/B] has been used long before Hungarian [I]Notation[/I]. From Wikipedia: "[I]The original Hungarian notation, which would now be called Apps Hungarian, was invented by Charles Simonyi, a programmer who worked at Xerox PARC circa 1972-1981, and who later became Chief Architect at Microsoft. It may have been derived from … | |
Re: [QUOTE=minghags;1693950]Hello! I wanna ask you guys for help with this program. Here is my problem explanation: I want that user gives an input in the beginning of the program how big should tictactoe board would be. For example: input: 4 so board would be 4x4. Code of the current problem … | |
Re: [QUOTE=az.rathore;1693987]hi i am new to c++ i have problem to solve kindly help me Start with any positive number n. If n is even divide it by 2, if n is odd multiply by 3 and add 1. Repeat until n becomes 1.For example sequence that starts at n = … | |
Re: [QUOTE=DoubleZ;1679735]Hello, so I recently started reading on arrays and I have an assignment to make a program that removes the necessary elements from an array of integers so that the array consists only of increasing integers, for example, transform {2,3,5,1,6,2,3} to {2,3,5,6}. Now, I do not know of any possible … | |
Re: [QUOTE=coolbeanbob;1691137]Hello all, I am trying to write the constructor for the HashTable class, so it will create an array when a HashTable object is created. With the code below, I am getting the errors: error C2466: cannot allocate an array of constant size 0 error C2133: 'arrayTest' : unknown size … | |
Re: [QUOTE=knowill;1691148]very dificult oop, exception, inheritance task pleas. sorry, i'm hope you understand me.[/QUOTE] very large kittens, notwithstanding, inherit some peas. i'm hope you understand me. | |
Re: [QUOTE=ktsangop;1688492]Hello everyone! I want to add a licence expiration feature in my application (written in visual c++). When the licence expires i would like my application to generate a random numerical key which will be sent to me by the user. Using this key and a personal key-generator i would … | |
Re: [QUOTE=charleneok;1689250]Anyone know how to do this question? Use recursion to implement the following recurrence relation f(x): f(x)=1 where =1 f(x) = f((x+1)/2) +1 where x is odd f(x) = f(x/2) +1 where x is even This is what i did: [CODE]#include<stdio.h> int func (int x) int main() { int x; … | |
Re: [QUOTE=DeftArcher;1687830]This is the assignment: Write a class named Employee that has the following member variables: name. A string that holds the employee’s name. idNumber. An int variable that holds the employee’s ID number. department. A string that holds the name of the department where the employee works. position. A string … | |
Re: [QUOTE=Phillamon;1679429]Hi All! I've got a weird problem here...It doesn't want to add my int values to a char array even though I static_cast the value to char. If you could just look at my code please! [CODE]void AltBoolean::print(){ perma = new char[arraySize]; int temp; int counter = 1; for(int i … | |
Re: [QUOTE=annette123;1677840]Hi,I spent all night trying to figure this out. Could someone take a look and show me what I'm missing? I getting this compiler error: [B]unterminated #ifndef [/B]. But I have [B]ifndef[/B] at the beginning and [B]endif[/B] at the end of the class. [CODE]//Header file. //Class definition for teh stack … | |
Re: [QUOTE=ayeshashahid;1675690]i have a serious problem with this malloc function used in C language.i have been studying the topic "new" for few days,and there i found a code in which malloc was used.i am trying to change it to new but my compiler always always CRASHES. the line which i think … | |
Re: [QUOTE=Knar;1675693]Ey all. Im folowing a c++ course and im stuck writing string or char arrays to matrices. The problem is i have a matrix of size [i][j] with random values from 0 to 3. Each of these values have to correspond to either a string or char array. 0=EMPTY 1=RES … | |
Re: [QUOTE=QQnoobie;1663053]Trying to define a function that dynamically creates a Student object and then prompts the user for the info and returns pointer to a Student object. [CODE]class Student{ private: string firstName; string lastName; string aNumber; double GPA; public: Student (); Student (string f, string l, string idNo, double gPoint); string … | |
Re: [QUOTE=Obelisk4;1662641]Hi everybody ^^ I'm quite a newbie in loading image file, so I've try to improve myself by loading the TGA image structure (You can found it at [url]http://en.wikipedia.org/wiki/Truevision_TGA[/url], I'm quite believe in the information there) My problem is after loading and draw it onto the screen using OpenGL ES, … | |
Re: [QUOTE=sunn shine;1661171][CODE]//class node #include <iostream> #include <string> using namespace std; //CLASS NODE class Node { public: string object; Node *nextNode; //next part of node Node *prevNode;// public: //get object string get() { return object; }; //set object void set(string obj) { this ->object =obj; }; //get next i.e adress of … | |
Re: [QUOTE=Muel12;1660766]Hello Everyone My background: Civil/Structural and Mechanical Engineering. I work as a Structural Engineer designing bridges. I would like to develop a program that analyzes and design structures but do not know much about software development. I have created a library of spreadsheets that are very powerful and when working … | |
Re: [QUOTE=Sunshine2011;1659427]Ok. Thanks for this solution. If I understood it correctly, one could create a vector within a function, but there is no possibility to pass to it with a reference. But this could be a nice possibility to destroy the vector if there is no use for it any longer. … | |
Re: [QUOTE=Will Gresham;1660955]Hello, I am having an issue with C++. I am relatively new to this language. The issue I am having is that I am unable to use a variable declared as private in my class. Definition: [code] class Matrix { public: Matrix(void); Matrix(int rows, int cols); Matrix(const Matrix& m); … | |
Re: [QUOTE=murnesty;1657767]if i declare size 5 array [CODE]char ch[5]={'1','2','3','4','5'};[/CODE] Then the null will store at the address ch+5 ? even i didn't declare the size for the null to place. If so mean it may overlap value on that memory address?[/QUOTE] No. The compiler will ATTEMPT to put a null value … | |
Re: [QUOTE=meli123;1653316][CODE]int m, n, pow; cout << "Enter m and n: "; cin >> m >> n; pow = 1; for (int i=1; i<=n; i++) pow = pow * m; cout << m << "^" << n << " = " << pow << endl; return 0; }[/CODE] I dont get … | |
Re: [QUOTE=Caligulaminus;1653326]0 to 255? I see...[/QUOTE] Anything bool can do, char or byte can do. It only exists as a courtesy to programmers so that when we can use the keywords true or false. What is happening behind the scenes is that when we assign something a value of false, we … | |
Re: What's happening here? Will this loop ever exit? [CODE]while(flag[1] == true && turn == 1) { }[/CODE] | |
Re: [QUOTE=Harley_Quinn;1648806]So here is my code for a sum function for a vector - using boolean success to just pretty much catch simple errors and what not However when I compile it says that success is undeclared in my int main() and I was just wondering how to properly declare it … | |
Re: [QUOTE=hqt;1646345]Who can teach me the purpose of stringStream, and how to use it, please. I have read some paper about this, but I still have something don't understand.[/QUOTE] Stringstream is identical to a file stream, except that there is no file. Instead it stores the information in a string container. … | |
Re: [QUOTE=trejorchest;1646659]Here is the assignmnent I need to complete: "Write a program to calculate and print the result of the following two operations: 1/1 + 1/2 + 1/3 + 1/4 + 1/5 + ... + 1/99999999 + 1/100000000 and 1/100000000 + 1/99999999 + 1/99999998 + 1/99999997 + ... + 1/3 + … | |
Re: [QUOTE=falconmick;1645533]I know that this is probably a stupid question :\ but I am stupid... I am getting [ICODE]1>angledCollision.obj : error LNK2001: unresolved external symbol "protected: static class angledCollision * Singleton<class angledCollision>::ms_Singleton" (?ms_Singleton@?$Singleton@VangledCollision@@@@1PAVangledCollision@@A) [/ICODE] [ICODE]1>spawningArea.obj : error LNK2001: unresolved external symbol "protected: static class angledCollision * Singleton<class angledCollision>::ms_Singleton" (?ms_Singleton@?$Singleton@VangledCollision@@@@1PAVangledCollision@@A) [/ICODE] I … | |
Re: [QUOTE=addision;1644950]Please help. I have an assignment for a class and I have been working on this for a week. Nearly all of it I finished in two days but I have been stuck with this problem for 5 days now. I am using MS VC++. I am having quite a … | |
Re: [QUOTE=HelpStudents;1641818]If I have a vector of structs [CODE] struct widgets { string widgetName; int age; int color; }; [/CODE] and widgetName had multiple words in lets say widget one type 45 blue widget two 34 yellow widget eight 46 green widget ten type 33 pink and I wanted to search … | |
Re: [QUOTE=Celcion;1642245]Thanks for your reply. Sorry for being vague, I guess I could say I was looking for generic examples. Here's my code, although some of it still needs working on. [code] #include <iostream> #include <string> #include <vector> #include <iomanip> using namespace std; //Entering protofunctions first void UserVerif (); void UserCreate(); … | |
Re: > Hello, currently new to C++ and learning the ropes. > I'm trying to create a simple database-like program, but the following code doesn't output any meaningful data. The program compiles fine, though. > > The rest of the program is still under work, so I'm just posting the relevant … | |
Re: [QUOTE=ksm092;1629155]This is my code: [CODE] void removeAppointments() { vector <string> newfile; string line; int i; int n; ifstream Appointments; ofstream newAppointments; Appointments.open(DATAFILE); newAppointments.open(newDATAFILE); if (Appointments.is_open() && newAppointments.is_open()) { // Read the file until it's finished, displaying lines as we go. while (!Appointments.eof()) { getline(Appointments, line, '\n'); // getline reads a … | |
Re: how to train a kitten to eat mangoes,if two kittens are equal,keep the mangoes otherwise goodbye kittens.please help. | |
Re: I'm curious as to why you can't use polymorphism like they suggested to have the object run its own specific function to do whats needed. | |
Re: [QUOTE=dilequeno;1609239]I am trying to create a very large 3D array. I am currently using a psuedo-3D array with a 1D array. Here is what I have so far: [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> #include <istream> #include <string> #include <vector> #include <numeric> using namespace std; const int depth … | |
Re: [QUOTE=riotburn;1607710]I've made a shape base class along with a bunch of derived classes. I have an object array of derived objects and a loop to do the function but am getting this error: error LNK2001: unresolved external symbol "public: virtual void __thiscall Shape::drawObject(void)" (?drawObject@Shape@@UAEXXZ) Thought it might be a problem … | |
Re: [QUOTE=clickspiker23;1590944]I am currently going through a c++ book trying to do the problems at the end of the chapters. They dont provide solutions so im kind of stuck. My problem is: Write a program that uses a loop to display the characters for each ASCII code 32 through 127. Display … | |
Re: [QUOTE=Tinee;1549336]Hi, Im trying to compare an inputted string to an array of string. If the inputted matches one of the array of string it should return 0, but if not it should return 1. Any suggestion on how to do this? This is my program: [CODE]{ for ( int j=0; … | |
Re: [QUOTE=andimiami;1549175]I am doing a program involving an unsorted list of names that I have to turn form Firstname Lastname into Lastname, Firstname. So I wrote the main program, and my instructor told me that under my getList function, to retrieve the data just do data >> first and data >> … | |
Re: [QUOTE=ayan2587;1535310]Hi guyzz !! I have tried scouting the internet but could not get a suitable explanation. Please tell me with an example as to what are bit arrays and what are their applications. Any help would be greatly appreciated. Thanks[/QUOTE] Yeah like Evan said, you can use bitset to create … | |
Re: [QUOTE=rogba;1526817]right now my program asks for 5 candidates but i want to make the user input as many candidates as they want to. how would i go about doing that?? #include <iomanip> #include <string> using namespace std; int sumVotes(int list[], int size); int winnerIndex(int list[], int size); int main() { … | |
Re: [QUOTE=kk33;1535937]Hi I am trying to convert the outbuff from WinHttpQueryHeaders to string but its not working properly... my code [CODE] if( GetLastError( ) == ERROR_INSUFFICIENT_BUFFER ) { lpOutBuffer = new WCHAR[dwSize/sizeof(WCHAR)]; // Now, use WinHttpQueryHeaders to retrieve the header. bResults = WinHttpQueryHeaders( hRequest, WINHTTP_QUERY_RAW_HEADERS_CRLF, WINHTTP_HEADER_NAME_BY_INDEX, lpOutBuffer, &dwSize, WINHTTP_NO_HEADER_INDEX); } } … | |
Re: [QUOTE=NvIs;1527038]Well I'm working with structures and need some help with a program. Now if the user chooses to deposit more, I need it to add to the last amount entered... But I'm not sure how to go about doing so. [CODE]#include <iostream> using namespace std; struct the { int num; … |
The End.