49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
[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; … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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> … | |
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 … | |
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 … | |
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. | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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: … | |
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) | |
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 … |
The End.