49,761 Topics
| |
Hello all, My understanding is that the Objects created are stored in the heap segment. What if the objects are created for a class with static data members? Do the static data alone reside in the data segment, while the rest of the members are allocated on the heap? I … | |
I was humming along, and decided to try out data sorting. So, I did a few pieces of research, and came up with a really cool looking algorithm: Quicksort. I did what I should have, and started to program. Now, here is where I sound like an idiot: Why is … | |
I am trying to make an ATM machine, while trying to teach myself how classes interact with each other. I feel as though the main idea of the program is correct, but as you can see, I am having a lot of syntax errors. If you guys see something that … | |
Generate the multiplication table for n numbers up to k terms( nested loops). Hint : 1 2 3 4 5 …. K 2 4 6 8 10 …..2*k ……………….. ……………….. n ……………….. nK give me the code in c++ | |
Okay, so I've been searching the internet for hours trying to find the solution to my problem. Many came close, but didn't describe exactly what I want to do. I have an excel file that displays the names, locations and other information about certain servers for work. I want to … | |
What I really wanted was a single class, ImageSegmentation<T> that operates on images of type T. The problem was that this object needed to be a member of my Qt form object (called Form), but I didn't know T until runtime (the user selects which type of image to operate … | |
Hi all, I have following string 0x0002,A5651QPR87GBZ094RTF52,D,A,000001,ABC ,10000.00 , EOT i need to split the above using ',' as the delimiter & put those in to the following string variables. 1.Command 2.Key 3.Msgtype 4.number 5.name 6.amount pls reply me as sap. Regards | |
I have an assignment to show a brute force algorithm on combination and permutations. All I am given is the function headers, and I cannot see the main. I'm having trouble understanding how sets work... Here is my header function for combination [code=c++]set< set<char> > powerSet(set<char S>)[/code] now, I'm not … | |
Hello, I'm working on a function that is supposed to impose brute force algorithm on a set of chars. Here is what I have so far [CODE]set<string> permutation(set<char>S) { set<string> fun; string myString; do{ for(set<char>::iterator it=S.begin(); it !=S.end(); ++it){ myString += *it; } fun.insert(myString); }while(next_permutation(S.begin(), S.end())); return fun; }[/CODE] due … | |
I have this code here [code]#include <iostream> using namespace std; int checkLevel(){ int exp[101]={0,1,6,21,51,100,172,274,409,583,800,1064,1382,1757,2195,2700,3276,3930,4665,5487,6400,7408,8518,9733,11059,12500,14060,15746,17561,19511,21600,23832,26214,28749,31443, 34300,37324,40522,43897,47455,51200,55136,59270,63605,68147,72900,77868,83058,88473,94119,100000,106121,112486,119102,125971,133100,140493,148154,156090,164303,172800,181585,190662,200038, 209715,219700,229997,240610,251546,262807,274400,286329,298598,311214,324179,337500,351181,365226,379642,394431,409600,425153,441094,457430,474163,491300,508845,526802,545178,563975,583200, 602857,622950,643486,664467,685900,707789,730138,752954,776239,800000}; int level = 1; int nextLevel = 2; int PokemonExp = 0; int input; int num = 1; while (num == 1){ cout << "Enter exp amount: "; cin >> input; PokemonExp = … | |
Hello, Once more, I'm having a problem which I've been breaking my head about for a few hours searching Google to no avail, and came here again for some consult about. The thing is this; I have an image file, the size of 16x16 pixels, and I want to paint … | |
Hi Everone, I need Help With My code If there is any mistake Please Let me Know I will correct it it is a ping program it will ping an ip address or an address like [url]www.daniweb.com[/url] [CODE]#include <windows.h> #include <iostream> #include <conio.h> using namespace std; int main() { int … | |
I do not know if I should use a 2D or just two seperate arrays to make this easier. I have two arrays. One is just an array like {1,2,3,4...n} and the other has values that correspond to those and make pairs. I want to create an array that stores … | |
Hi guys, I am new to C++ and am trying to display the contents of an array in the form of {1,2,3,4} but am having some difficulties, they get printed but there is a trailing comma {1,2,3,4,}....how can I get rid of this? this is my code: [CODE]cout << "\nArray: … | |
hi is there anybody that can help on Havok Physics engine. I want to implement havoks physics into a racing game, at the moment iam keeping it very basic , havok aside i have my car model with joining wheel nodes and body node and a floor for it to … | |
Hi Iam running into a problem when using classes and inheritance. I have a base class which contains a member function whos job it is to create and intialize some variables that are shared between other classes. The other classes are inherited from the base class and the variables are … | |
The code works, I just want to see if someone can help me cut lines in main only. [CODE]#include <iostream> #include <sstream> #include <windows.h> #include <time.h> #include <string> using namespace std; struct tm * timeinfo; // Holds information about time in form of struct class Date { public: int m_nMonth; … | |
I need a c++ coding that can compress a file | |
Hi, i have: [CODE]string letter; cout << ">Please enter a letter: \n>"; getline(cin, letter);[/CODE] What i am trying to work out is how to restrict the user for only entering one letter - has to use a string due to being used in a function later which only takes a … | |
This is giving me a segmentation fault in the noBucket() function. I don't see why. Does it having something to do with it being a const function? My other accessor functions are working fine and they are declared exactly the same with just a different name. The files are longer … | |
I have a vector that with your help I succeeded to make it work just fine. Now I want to make the same vector to work with float values but just doesn't want to make me the mathematics with float numbers. Is adding only the integers and not the float … | |
Hey all. I'm trying to learn stack operations and so far, I believe I've gotten push() and pop() down. I seem to be stuck on copy, however. I cannot get a check for empty to work correctly. [CODE] typedef struct _node { payload data; struct _node *prev; } node; int … | |
So i'm not looking for anyone to give me code on how to do this. I would just like a tip or two. I have a .txt file with a deck of cards in it saved into a card struct like : [CODE]struct card { char suit; char value; };[/CODE] … | |
i want to make some graphical programs in DEV C++,plz name some libraries of DEV C++ for making graphical libraries???? | |
[CODE]class A { public: int a; A() : a(100) { } }; class B : public A { public: int b; B() : b(200){ } }; int main() { A a; B *ptrB =(B*)&a; cout<<ptrB->b<<endl; // Is there a way to get this to print 200?? }[/CODE] | |
[QUOTE] I'm having trouble getting the player's name and score to display as well as the average score. I have been at this for about 3 hours. I think it's time for a fresh set of eyes. Can someone please help?! This assignment is due tomorrow. Thanks [/QUOTE] [CODE]#include <iostream> … | |
Im in dire help of needing to do the following: 1. Write a function which will take a grade as an argument and validate it for domain (in a valid range). Return true if valid, false if not. 2. Write a function which will take a grade as an argument … | |
In my program that uses separate compilation, the only problem I have left is a linker error. To see if it was just a syntax error somewhere obscure, I made a simple "hello world" program that uses separate compilation. I get the same error. The code is below. If someone … | |
hey guys,I'm soo beginner in C++ :$ .could you please explain logic of the loop [CODE]#include <iostream> using namespace std; int main() { int x = 0, p = 5; while(x < p) { for(int i = 0; i < x; i++) { cout << "+"; } cout << "\n"; … |
The End.