49,761 Topics

Member Avatar for
Member Avatar for scott6480

I have to write a program for class that will read a datafile into a structure. The data file is a menu of food items at a fast food restaurant. Basically simulate a cash register I created a structure menu[26] which includes the following elements key - a,b,c,d etc. item …

Member Avatar for jonsca
0
83
Member Avatar for hpfreak08

I have to make a recursive function that is passed a location in a previously allocated 2D array, and changes the "color" (indicated by a letter) from the "oldColor" to the "newColor." The function then changes any adjacent elements containing the "oldColor" to the "newColor." (If you are confused by …

Member Avatar for hpfreak08
0
146
Member Avatar for dondulla

hi, unfortunately i need a bit of help with a config for a program that an ex-employee of ours wrote. Basically, the program verifies itself on a website and verifys one specific type of bluetooth hardware is connected. we have recently changed hardware suppliers and need to take the requirement …

Member Avatar for NicAx64
0
115
Member Avatar for brad82

Hi all, Im new here - so please bear with me ;) Im pretty new to C++, although I have previous experience in C. I created a small socket app that allowed a client to connect via telnet and send some data for it to be assessed. I have recently …

Member Avatar for brad82
0
86
Member Avatar for hussamo

[code=c++] #include <iostream> #include <string> #include <cmath> #include <cstring> #include <cctype> using namespace std; class link { struct employee { int x; employee *next; } void insert() { employee *temp; temp=new employee; employee *first; first=new employee; if(first=NULL) { employee *tmep; temp=new employee; temp=first; cin>>first->x; first->next=NULL; } else { temp=first; first=temp; …

Member Avatar for mrnutty
1
69
Member Avatar for squigworm

Hey everyone, I am looking for some guidance in regards to the track of my programming related education. I am about to finish my first intro to programming c++ class and love it. I want to continue studying programming but feel a little lost as to what is the best …

Member Avatar for squigworm
0
103
Member Avatar for javaconfused

The Demetris Leadership Center publishes the books, DVDs, and CDs listed in the following table: Title: Description Product Number Unit Unit Sold Brave New World Book 110 25.50 925 Lady Gaga CD 111 16.00 275 The Forgotten DVD 112 24.50 289 Twilight DVD 113 45.50 135 The Giving Tree Book …

Member Avatar for tkud
0
121
Member Avatar for hussamo

[CODE][/CODE]// i need a linked list that can do those functions //-------->>> insert , delete ,search ,check if empty ,print <<<----------- // plzzzzzzzzzz i can't inderstanund //i did understand the insert functoin but the other not :'( [CODE]#include <iostream> using namespace std; class link { public: struct employee { int …

0
59
Member Avatar for dotnabox

So for my latest assignment, I have been asked to convert our LinkedList and ListNode classes to template classes. I understand the general idea of templates, but all of the examples deal with more concrete examples. I'm having trouble extending it to my multi-file project with intermingled data types and …

Member Avatar for dotnabox
0
133
Member Avatar for infern0

I have to write a program that calculates the avg, min, and max. The program runs fine, but when a user decides he doesn't want to enter any scores (enter: -1) in the beginning it still tries to calculate the avg,min and max. I need the program to end w/o …

Member Avatar for pecet
0
115
Member Avatar for EngneerNitemare

I built this entire program and it does what I want it to except I want to use a bubble sort algorithm instead of the [CODE]std::sort()[/CODE] function I have right now. So please help me out on this. I don't really understand how bubble sorts work even after reading up …

Member Avatar for mrnutty
0
2K
Member Avatar for maverick405

Hi, I am trying by best to code this program which takes user input of ten different numbers and displays it's square and cube, from the below code I can display the square of input numbers but in cube i am having problem please help me solving this. [code] #include …

Member Avatar for mrnutty
0
138
Member Avatar for tolby99

Hi, Can anyone fix this code that i have made here. the objective to the program is -to make an array for an unknown number of integers. -Quit value is -1. -Keep track of how many numbers in array -If array is full output full message (full is 25 numbers …

Member Avatar for donaldw
0
128
Member Avatar for C3PO

When i use dlopen to dynamically load a library it seems i can not catch exceptions thrown by that library. As i understand it it's because dlopen is a C function. Is there another way to dynamically load a library that makes it possible to catch exceptions thrown by the …

0
62
Member Avatar for kent01981

Hi people, Can anyone helps me out. I need use C++ to do this: [U]"Use polymorphism to build an object which can be stored in a datastructure such as an stl::map but uses polymorphism to perform different actions depending upon the type. You may find an stl::map is also useful …

Member Avatar for Nick Evan
0
180
Member Avatar for nida

i have made a programe of queue in c++ code is : [code] #include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<process.h> #define maxsize 5 struct que { int items[maxsize]; int rear , front; }; void insert(struct que *,int); int remove(struct que *) ; int empty (struct que *); void makenull(struct que *); void …

Member Avatar for Me_Nit
0
228
Member Avatar for bpt0004

I'm trying to run my program but i can't find out why its giving me a segmentation fault. Please Help. [CODE]#include <cmath> #include <cstdlib> #include <ctime> #include <string.h> #include <fstream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <ctype.h> #include <vector> #include <cctype> #include <algorithm> #include <iterator> #include <iomanip> #include <cstdlib> …

Member Avatar for donaldw
0
134
Member Avatar for skalber

Hey, I got a problem with my multi-threaded application. I have one thread that waits for an event to be signaled, when it happens it calls PostMessage and passes a handle of the main window created by the GUI thread with a custom message I handle in my window message …

Member Avatar for skalber
0
90
Member Avatar for AdRock

I have some code i've written and i need to splita string and assign the results to 2 variables type and value The first part of the string up to the : would the type and what is after the : would be the value When i output the variables …

Member Avatar for Ancient Dragon
0
91
Member Avatar for varun_p_n

I have a com component that logs error details. I wan't to delete the log files that were created one month back. Where this code has to be written ? I mean it should be run only once when the COM compponent is loaded for the first time.

Member Avatar for Ancient Dragon
0
392
Member Avatar for racumin

Hi, in java, I can use packages to combine classes which have similar traits. For example, I have a package "worker" and classes in this package contains "Programmer.java" and "Designer.java" I want to know how to do this in C++. What I did was this: 1. created a source folder …

Member Avatar for Ancient Dragon
0
94
Member Avatar for gauravkr

Hi Guys!!! I'm Gaurav Kumar presently in sydney for my higher studies. I come from the Patna city of India...Hope to see a good discussion on c++ as i'm fairly new to this programming language....... I wish you all a very healthy discussion and happy knowledge sharing... best regards Gaurav

Member Avatar for surindersharma
0
60
Member Avatar for kjiu

Hello, I have to change this code (c++) on Java, can you help me. [CODE] QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName) { QFile file(fileName); if (!file.open(QFile::ReadOnly)) return new QStringListModel(completer); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); #endif QStringList words; while (!file.atEnd()) { QByteArray line = file.readLine(); if (!line.isEmpty()) words << line.trimmed(); } #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif …

Member Avatar for masijade
0
81
Member Avatar for Joebrauk

Hey, I'm new here. Just getting into c++ programming and saw some great resources on this site. I figured out how to print a fully random array, but I need help printing an array like this. 1 2 3 2 3 1 3 1 2 It could be any three …

Member Avatar for mrnutty
0
74
Member Avatar for StaticX

I am trying to make a small program which will write to a binary file,this is my code: [CODE]// program that writes to a binary file #include <iostream> #include <fstream> using namespace std; main() { fstream* bfile = new fstream("file.bin", fstream::out | fstream::binary | fstream::ate); int a = 2; int …

Member Avatar for Nickg140143
1
263
Member Avatar for koool.vaibhav

pthread_mutex_lock() call never returns causing other threads to wait for gaining its lock forever in turn causing 100% cpu load. I have tried using alternate call pthread_mutex_trylock() which try to lock and if the mutex is locked in some other thread it returns with an error code. The above mentioned …

0
37
Member Avatar for maverick405

I am trying to find the average for the 10 different integer input from user and then to fine numbers above the average and below the average, I dont know what is wrong the code below executes and i am able to input 10 different integer but after that the …

Member Avatar for maverick405
0
96
Member Avatar for basketball4567

I need to write a minimal spanning tree program and cant seem to get it working. can you please take a look at my code. The problem im having is the checking for cycles part of the code. Any help would be great. my input from file looks like this: …

0
74
Member Avatar for vijaykalmani

Please help me on 1) C++ pgm to reverse a linked list 2) Given 2 lists L1 & L2, create a 3rd list which is intersection of L1 & L2 3) Given an infix evaluate it without converting it to postfix (hint use 2 stacks)

Member Avatar for vijaykalmani
-2
100
Member Avatar for disturb

Please can anybody try and figure out these two questions here. "Q1: **Using the following class definitions of stack and queue classes write a templated function reverseQueue(?), that takes a pointer to queue as a parameter and uses stack object (or pointer to a stack object) to reverse the given …

0
49

The End.