51,592 Topics

Member Avatar for
Member Avatar for firewall321

Hey guys, i'm kinda desperate.. because of illness I had to miss 2 months of uni, I was seriously sick and could not even leave house for that time, now it's an exam time and I have no idea how to write it.. fortunately our teacher gave us 8 small …

Member Avatar for T-Dogg3030
0
125
Member Avatar for Nethran

First off, some setup. I'm doing the final course project for my C++ class, and this is the first time I've had trouble. The things I'm supposed to be doing in this assignment seemed a lot simpler before I started working on this, and now I'm just hitting walls. The …

Member Avatar for Nethran
0
355
Member Avatar for Harshita_garg

Hi! I am working on a project in which I have some variables & I have assigned certain default values to those variables.Output of the project should be somewhat like as shown below :- a = 10 b = 20 c = 1 d = 4 ... & so on …

Member Avatar for azeem abbas
0
221
Member Avatar for Coach_Nate

I was wondering if there is any way to parse integers from a string (like in java)? Anyone know of a built in function in c++?

Member Avatar for rubberman
0
261
Member Avatar for vikuseth

I am using one dll in my application for including the functionality provided by that dll . This dll i am getting after installing one msi . But in my application i have a requirement like if the user has not installed that msi then we have to show one …

Member Avatar for rubberman
0
229
Member Avatar for phorce

Hey, I have a function in C that I am trying to convert over to C++. I have done everything, apart from this line: memcpy(mel[i],&temp[melstart[i]],mellength[i]*sizeof(double)); I need a way of copying the elements in temp[melstart[i]] over to a vector of doubles.. Here is the C code: void Setup_Mel(int fft_size, int …

Member Avatar for mike_2000_17
0
173
Member Avatar for kdar

Hello everyone, I am working on one program that generates a lot of data...eventually it can be in GB range. And the way I am doing it now is just by writing to ascii file everything time... like this: ofstream flowC("outputfile.out"); // declared at the start flowC << prevsid << …

Member Avatar for L7Sqr
0
615
Member Avatar for TheBrick

Hello all, I have a class with a std::set member that I am trying to send to terminal via std::cout. I am trying to achieve this by iterating through the set and dereferencing the iterator. I am unable to achieve this. Anyone able to point me in the right direction …

Member Avatar for TheBrick
0
237
Member Avatar for ayieye

I am working on a math tutoring program that asks the user two random numbers from 10 to 100, and asks them to key in the correct answer within 5 seconds .the program must ask ten questions showing them and then display the score

Member Avatar for ninidesobra
1
189
Member Avatar for Vish0203

I'm new to win32 application building using C. I'm using DEV C++ and I'm able to get a window, by using the "windows application" icon in DEV. I want to know how to display our text on to the window??? That'll be very helpfull! This is the readymade code generated …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for M4ver1k

I'm trying to iterate through a struct, but wanted to be able to do something along the lines of: string searchy = "jimmy"; string suffix = "firstname"; for (person dude : pnum){ if (dude.&suffix == searchy){ // Do things } } For those familiar with Perl/PHP, I'm trying to accomplish …

Member Avatar for M4ver1k
0
276
Member Avatar for kaywt

Ok... Got a lab to generate 150 random numbers and then sort the 1st 50 by BUBBLE SORT, the 2nd 50 by SHELL SORT, and the 3rd 50 by SELECTION SORT. After I get those three to work correctly then I need to MERGE SORT the three of them together. …

Member Avatar for kaywt
0
181
Member Avatar for np2100

Hello I have been thinking for a while on how to do this one program in c++. I am trying to make a quiz in c++ with 4 yes or no questions. After the quiz has been taken I want to have it ask another question depending on how many …

Member Avatar for Gonbe
0
341
Member Avatar for vikuseth

#include "B.h" class A { public : A() { s_b = new B(); b = new B(); } static B s_b ; B b ; }; #include<iostream> using namespace std ; #include "A.h" int main() { cout<<"hello"; } In my project i have seen static object as above . But …

Member Avatar for deceptikon
0
181
Member Avatar for Agni

I have a some libraries which have a lot of common classes but the namespaces are different. Most of the code I was writing could be easily reused by classes in both libraries so after some reading I tried a technique of using the templates to pass namespace. As you …

Member Avatar for Agni
0
126
Member Avatar for thePAkid

I'm trying to output data to a file. I half killed myself trying to get the program to work , everything works all data is working except for a few errors will show later. Heres my code // Week 13: In Class Exercise - 5 Solution #include <iostream> #include <string> …

Member Avatar for thePAkid
0
248
Member Avatar for sandorlev

I have started writing a *really* basic tile engine in C++ and I'm not entirely sure when to use const return values. Should I use them in cases like this class A { private: Rectangle hitBox; public: A(); const bool Collision(const Rectangle& hitBox2); }; or is it totally pointless?

Member Avatar for mrnutty
0
244
Member Avatar for TheBrick

Hello all, A simple problem for anyone who know Qt, I'm very new to Qt and GUI programming in general. I’m on a linux platform and using Qtcreator. I have a window (see [here](http://1.bp.blogspot.com/-QM3EiY3oh5Q/UMeo8rb4fUI/AAAAAAAAAWY/tWPLdEl6OgM/s320/box.png) for a screen shot). I wish to have two "sub regions" (incorrect terminology I’m sure) within …

Member Avatar for TheBrick
0
241
Member Avatar for FakeTales

is it possible to pass an already defined function into a pthread? so for example within my code i am able to define an array size once a user enters an array size(for example user enters 200) it will add the numbers 1-200 to an array , i then have …

Member Avatar for FakeTales
0
236
Member Avatar for mitrious

10-4. Write a class that implements a list that holds strings. 10-5. Write a bidirectional iterator for your String_list class. 10-6. Test the class by rewriting the split function to put its output into a String_list. there are theses three exercises in the book I'm studying, what is it asking …

Member Avatar for DinoG
0
433
Member Avatar for pjh-10

#include<iostream> #include<cmath> #define pi 3.1415926535897 using namespace std; int main () { double lat1; double long1; double lat2; double long2; // initilaise values double latz; double longz; double a = 0; double c = 0; double distance = 0; double x = 0; double y = 0; cout << "enter …

Member Avatar for pjh-10
0
166
Member Avatar for nitin1

if i want an array of 10000 ints and i just nned to use it like array only (not the functions which vector have seprately from array), then i make an array int a[10000] and vector<int>a(10000); then memory allocation time will be different for them ? if yes, then please …

Member Avatar for ravenous
0
144
Member Avatar for loldafuq

Write a program with a function main () and selecting a menu of functions: Generate a programming-random number generator data for lottery ticket / max 100 / with six-digit numbers and store them in an array -Overwrite generated a new array and sort this array in ascending order and display …

Member Avatar for Lucaci Andrew
1
1K
Member Avatar for danielkull

Hi, I have a function which returns a pointer to array with data: `float * EZ_MATH::EZ_GE_BY_ME() { ... }` Now, how can I access this data? This doesnt work: `float * memA = temp_m.EZ_MATH::EZ_GE_BY_ME();` `ofstream output("out_file", ios::out);` `output << memA[0] <<endl;` `output << memA[1] <<endl;` Help!

Member Avatar for ravenous
0
288
Member Avatar for kimika

#include <iostream> #include <string> #include <iomanip> #include "mainmenu.h" using namespace std; string bookTitle[20] = {""}; string isbn[20] = {""}; string author[20] = {""}; string publisher[20] = {""}; string dateAdded[20] = {""}; int qtyOnHand[20] = {0}; double wholesale[20] = {0.0}; double retail[20] = {0.0}; string searchTitle; int main() { // Declarations …

Member Avatar for VernonDozier
0
208
Member Avatar for aqWed_ton
Member Avatar for vmanes
0
78
Member Avatar for unsensible

So i've been working on this program for a couple of days and just cannot figure it out for the life of me. I'm fairly new to classes and methods so I think that's probably why. Here's the lowdown of the project: > New electronic monitors are being installed on …

0
70
Member Avatar for M4ver1k

Forgive me if the title was even worded properly. What I'm trying to accomplish is to be able to create an unlimited number of objects for use by struct and quickly realizing that my thought process on how to achieve that is wrong. Here's the related code: struct person { …

Member Avatar for M4ver1k
0
171
Member Avatar for ssh9411

I'm having an issue in creating my "Horse Race" program. I'm getting error "subscript requires array or pointer type" in my while(winner==false) loop at if(q==null) { tick[q]++; } and for(int q=0; q<numhor; q++) { if(tick[q]==10) { ... } } in addition to several places in my separate class files, even …

Member Avatar for ssh9411
0
3K
Member Avatar for futureeconomist

Not sure if I posted correctly. I am trying to do a bubble sort on a 2D array. I want to sort the array by columns. I get it to compile but it doesn't run correctly. #include <iostream> using namespace std; int main() { int array[10][10]; int col, row; cout<<"Enter …

Member Avatar for futureeconomist
0
5K
Member Avatar for deepecstasy

As you know how avl should be balanced after deletion of a node, I'll get to point. For starting, Im considering deleteing a node with no children. For Example a Tree: 10 / \ 5 17 / \ / \ 2 9 12 20 \ \ 3 50 Lets say …

Member Avatar for nitin1
-1
181
Member Avatar for marnun

> Write an EFFICIENT program that reads in the name of a file containing positive integers that are less than 1,000,000. The program prints out the integers in the file, in the order that they appear, eliminating duplicates. So if the file contained 8 3 1 9 2 8 15 …

Member Avatar for marnun
0
267
Member Avatar for cortland.boudreau

Hello, I'm working on an assignment and I'm having a bit of trouble. Around **line 12** it calls a **world->getOrganism(int,int)** However no matter what value of grid[][] I return it crashes. The if() should be checking to see if that particular grid cordinate is of the ant class. (dynamic_cast<ant *>(world->getOrganism(i, …

Member Avatar for cortland.boudreau
0
127
Member Avatar for MrBoye

how to write a program to stimulate a bank transaction. there are two bank accounts : checking and saving. first, askk for the initial balance of the bank accounts ; reject negative balance, then as for the transaction ; option are deposit, withdraw, and transfer. then ask for the account …

Member Avatar for Lucaci Andrew
0
266
Member Avatar for neewb

This program works fine, but I need help with the date validation. I have a regular expression that checks for dash patterns and integers and that is all. Is there some way I can add a date validation that can check for improper dates and leap year? If so, is …

Member Avatar for Gonbe
0
244
Member Avatar for kimika

#include <iostream> #include <string> #include <iomanip> #include "mainmenu.h" using namespace std; string bookTitle[20] = {0}; string isbn[20] = {0}; string author[20] = {0}; string publisher[20] = {0}; string dateAdded[20] = {0}; int qtyOnHand[20] = {0}; double wholesale[20] = {0.0}; double retail[20] = {0.0}; void main() { // Declarations for function …

Member Avatar for kimika
0
243
Member Avatar for wids101

my code freezes whenever i enter 12-19. #include <cmath> #include <iostream> using namespace std; int main() { int multiples; int answer; int square; int cube; int num; cout << "Please enter a positive number less than or equal to 20: ";\ cin >> num; do { if(num >=20) cout << …

Member Avatar for tinstaafl
0
99
Member Avatar for castilla

I need help with the editbook part on serendipity bookseller part 8 and the deletebook function as well this is what I have so far:

Member Avatar for Dani
0
35
Member Avatar for daino

I'm trying to build libgd and can't seem to get past this error. It configures without error but when I go to make Install the below error occurs. Would anyone know how to get past this? WinXP, MingW. Thanks. gdfontg.c:4380: error: variable 'gdFontGiant' definition is marked dllimport gdfontg.c:4380: warning: 'gdFontGiant' …

Member Avatar for daino
0
470
Member Avatar for akansha.jain.526438
Member Avatar for Super_android

Hey there, my code is nearly perfect, but I need help with my input for a value. here's the snippet of my code: cout << setw(15) << right <<"$" ; double Amount; input >> Amount; cout.setf(ios::showpoint); cout.setf(ios::fixed); cout.precision(2); cout.width(8); input.ignore(); cout << Amount << endl; i know that input puts …

Member Avatar for Ancient Dragon
0
152
Member Avatar for thammalatha

how can we use callback functions in handling events using ActiveX control? Can any one explain with simple example Thanks in advance..

Member Avatar for Ancient Dragon
0
83
Member Avatar for Scelus

Hi! As the headline suggests I am getting the following error message: First-chance exception at 0x00d690d1 in Nyår.exe: 0xC0000005: Access violation reading location 0xcccccccc. Unhandled exception at 0x00d690d1 in Nyår.exe: 0xC0000005: Access violation reading location 0xcccccccc. #include<iostream> #include<cstdlib> #include "Participantsregistryhead.h" int main() { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); ParticipatorRegister Registry; Registry.typeOut(); …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for doug.leany

I have a Code::Blocks project that includes a perl script which creates a c++ source file containing a linked list; the linked list is built by parsing special comments that may be included in all of the project's other .cpp files. The script is desinged to automate the creation of …

Member Avatar for doug.leany
0
379
Member Avatar for mattster

Hi all, We have just upgraded our btinternet router, and they gave me the old one to experiment with. The router is identical to [this one](http://upload.wikimedia.org/wikipedia/commons/7/71/BT_Home_Hub.JPG). A friend thinks a script would have to be written in C++. The router has all of its config stuff on a web interface, …

Member Avatar for phorce
0
302
Member Avatar for t2nator

Can anyone help me with this pratice question: 33 31 11 47 2 20 24 12 2 43. I am trying to figure out what the contents of the two output lists would be after the first pass of the Merge Sort. The answer is supposedly: List 1: 33 11 …

Member Avatar for NathanOliver
0
140
Member Avatar for yheenzie.saldivar

can u please help me to make this program..a program that decide and accept y for yes and N for no.y to repeat the process and no for the exit of the program.. ASAP PLS..TENKS

Member Avatar for clubberlangMayo
0
97
Member Avatar for kshahnazari

I am trying to write a function that helps to find a smaller 2D array in another one . I wrote it but the problem is that it always finded the array when it didnt exist . the only thing I want is that to say does it exist or …

Member Avatar for mrnutty
0
231
Member Avatar for arslanh

Develop a telephone directory which is capable of doing the following: 1. Insert a contact 2. Delete a contact 3. Edit an existing contact (changing or modifying a record) 4. Search a contact (and display complete record on screen) a. Search through first name b. Search through last name c. …

Member Avatar for Ancient Dragon
0
287
Member Avatar for mathias.kastbjerg

Hi - I'm trying to make a databse with the produkts from McDonald, but i can't figure out how. It is supposed to both read and write. Here's what i've made so far... Hope U understand: #include <iostream> #include <fstream> using namespace std; struct Menu { char navn[50]; int pris; …

0
126

The End.