49,761 Topics
| |
Hey guys, I'm trying to run this code [code=c++] // Copyright (C) 2001-2003 // William E. Kempf // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include <boost/thread/thread.hpp> #include <iostream> void helloworld() { std::cout << "Hello World!" << std::endl; } … | |
I am trying to write an if statement to test whether two conditions are both true. However, my code does not work when I combine the both tests into one if statement like: [CODE] if((last_smallest < samples[i]) && (samples[i] < current_smallest)) current_smallest = samples[i]; [/CODE] I know it is possible … | |
> Specification: Display a menu > Find Errors in this program #include "stdafx.h" #include <iostream> //change io to iostream #include <string> using namespace std; // added I get the `Error 1 error C2065: 'choice' : undeclared identifier line 17 which is 'choice'` What am i missing? int main ()// added … | |
Hello! I am working on my project..my code looks fine but I always get a wrong output. For example: I enter 11 for hour, 05 for minutes. The output should be display 11:05...but anyway it shows me 11:5 The zero is gone?? Is there anything i'm missing?? Please let me … | |
Can anyone tell me why my recursive find function for a binary search tree isn't working? It keeps returning false when searching for items that are in the tree. Thanks. [CODE=cpp] template<class T> bool BST<T>::find(const T& sitem) const{ //Precondition: // A binary search tree exists // //Postcondition: // If item … | |
Make a project, consisting of 3 modules: student.cpp, course.cpp and register.cpp. Write source and header file for a program that registers students for courses. Design a class student, that stores the name of the student , the id number and array(vector) of all course numbers for which the student is … | |
Input Note: You must test object’s capability by using the provided driver. Then develop a new driver to process the Roman inventory list. Note you can add any new methods / friends functions to the extRomanType to complete the second part you deem necessary. The file will be in the … | |
I need to pass a 2D array of int's into a function, which is normally fine, but the issue is that I don't know the last depth of the array. I know how to do it if I knew the length of the last dimension, but it is user defined. … | |
I am reading in data from a textfile, specified by command line args eg.. <app> inputfile outputfile I have not yet done any file output, yet have developed some code. What I'm aiming for is printing out the shortest route from one node to another in a graph. *The graph … | |
This is a program which finds if a 7char word is a palindrome and if it is it writes it in CAPITAL letters if not in small letters e.g aBcDcbA => ABCDCBA;;; CheetAH=>cheetah; [CODE]#include<iostream> #include<math.h> using namespace std; int main() { int l,d; char c1,c2,c3,c4,c5,c6,c7; cin.get(c1);cin.get(c2);cin.get(c3);cin.get(c4);cin.get(c5);cin.get(c6);cin.get(c7); l=c1==c7||c1==c7+'A'-'a'||c7==c1+'A'-'a';cout<<l<<endl; l=l&&(c2==c6||c2==c6+'A'-'a'||c6==c2+'A'-'a');cout<<l<<endl; l=l&&(c3==c5||c3==c5+'A'-'a'||c5==c3+'A'-'a');cout<<l<<endl; d=l?('A'-'a'):('a'-'A'); … | |
Ok, so I'm done with my "Code Break" and I'm back in "action". A couple months ago I completely dropped programming to pay attention to other things in my life. I was only on the forums a brief period of time anyway, so most people probably don't remember me at … | |
Can you develop C++ game for a university project and provide in a week? I'll pay by PayPal. Please email me at [email]snipped[/email] I will reply an email with requirements. Thanks. | |
I'm having a problem with a homework assignment. I had to create a doubly-linked List class with an iterator. I have done this except there is one "display" method that displays a large integer that is stored in this List class. The method is constant and my custom Iterator class … | |
Hello, i am programming a spreadsheet as my assignment. I have done it but the last step is to make it so uncalculated cells linked to other uncalculated cells need to be calculated. meaning if A1 hold the formula A1 = a2+a3 and if A3 in turn holds another formula … | |
The program imitates a gambling card game. The program shows you three cards, then the program interchange them, and if you can guess correctly where a particular card is, you win. Here is some sample interaction with the program: Card 1 is the 7 of clubs Card 2 is the … | |
Hi, I have a homework assignment to copy the elements of one stack to the other except in reverse order. The algorithm is easy enough for me to figure out and implement. My only question is, I dont really understand how im supposed to add my own function to a … | |
In my program below, I am having problems running my program. The error I receive is "could not convert `nextPermutation(((char*)(&elements)), n)' to `bool'" I just want to print out the permutation of ABC. Will someone please check my nextPermutation function to see if everything is correct. I know there a … | |
Hi.... Can anyone help? char message[] = "This is a message."; Write C++ code to print the string out backwards. Thanks. | |
Hi guys, I am looking for a way to check for error. I have an array of names. The user will enter a name and it will check the list for that name. If that make is not correct, it will go back and ask the user to try again … | |
Hi everyone: I have written C++ code for populating a matrix/2D array with calculation results. Each column of the array represents results for a distinct time step. My problem arises because the rows of my results vector do NOT correspond to the rows of the matrix. The matrix includes extra … | |
Hello Every one ! This program is producing some strange output as it is only generating x = 6 :(,can some through some light that why is it behaving like this ? [code] #include <iostream> #include <stdlib.h> using namespace std ; main () { // Random Number Program int num,x … | |
I have been working on this code for two weeks. I think I have it down to the last couple of lines ie funtion to call from main. But I just cant seem to get it.. Please help, due at midnight..ANd this is my first class so be gentle. :), … | |
I am trying to write a student database. I've done most of it, however to improve im trying to write something that will display the infomation entered and then ask if this is correct, if it is then continue if not then start back at the entering data part. here … | |
I just can't seem to solve this. Heres what I want to do: I want my program to calculate movement, from one point to another. The function _updatepos is the main function, where I have troubles. It is supposed to, as the name says, update the position (posx and posy), … | |
Hi everyone I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and … | |
I have been given an assignment to plan, code, and execute a program to calculate data about a person. I am not here asking about how to code the program, but rather to troubleshoot at what's wrong with my compiler/command prompt. Here's what's happening: I will code a program in … | |
Is there such a function that will convert a double to a string? | |
Has anyone checked out the plugin for Visual Studio at codebarrel.com? | |
Hi everyone, I'm a moderately experienced C++ programmer and a network engineer. I’m having a weird problem with using an array of vector<char *>, which I’ve never tried to work with before. I’m working on a program which does the following: 1. Inputs and parses a file called [B]PREFIX_FILE[/B], which … | |
hi i want help in my project m working on the BOOK class. plz make USER class as m getting alot of difficulties in it...i will user ur code as a reference code and will write my own code after undertanding it thnx |
The End.