49,761 Topics
| |
function is x/y+z means (x/y)+z if you dont write to Z anything program says "ERROR: Operator-operand imbalance." program is that as it is above and my code is [ICODE]#include <iostream> using namespace std; class Calculator { int x,y,z; public: void arith_ex(int,int,int); }; void Calculator::arith_ex(int x,int y,int z) { cout<<"X="<<endl; cin>>x; … | |
Hi,everybody I am a beginner in c++;Could you please tell me how to change an iteration program to a recursive one and vice versa?It will be greatly appreciated if you could show me with the help of a few examples(programs). | |
Hi everyone, I'm having some trouble with my computer lately. When my computer boots, i want a lot of programs to load, half of them normally makes a tray icon, but my computer is so slow, the tray icons won't be created. So I've found a way to work around … | |
[CODE=c++] #include <iostream> using namespace std; //----------------------------------------------------------------------------- void UserMove(int &NumStones) /* Pre: NumStones > 0 Post: User has taken 1, 2, or 3 stones from pile */ { cout << "How many would you like? "; int TakeStones; cin >> TakeStones; while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones) { cout << … | |
Just wondering how do you create a queue system using pthread? I need to create 2 thread, one for putting in the queue number into an array and the other for removing the queue number from the array. | |
can anyone help me convert this to c++?? <?php function show_me($info) { $arr = array('fruit' => 'apple', 'car' => 'bmw'); return $arr[$info]; } echo show_me('fruit'); //or echo show_me('car') ?> | |
I have seen so many classes and inheritance programs but what I cant seem to know is when and why do u end up resorting in this statement [ICODE]#include "NameOfTheClass_h.h"[/ICODE] and I guessed that is when u have separated the class from class main(), that sounds like making your program … | |
Hi!!! How Are you I bring a new program which I have solve it ; but there are 7 error without explain please I hope that I have any body to help me and I will be happy thhhhhanks alot :) This is the question Consider the following class definition: … | |
:'( :icon_cry: i'm trying to make a snake game & i can't make the lenght of the snake increase & it's score & the fruit appears one time only & i have to press on the arrow all the time please help me in this code today please. i've thought … | |
Okay I have a small problem. I have to load a file which contains (for example): a bleh b blah c bloh So basically it contains a character(1,2,3,..etc) followed by a string (bleh,blah,bloh etc..) I have to create a struct which should contain a char and a string, they will … | |
i trying to input the text from a text file into a byte buff[]. When i did this byte buf1[] = word; it will prompt me with "initializer fails to determine size of `buf1' " and invalid initializer error. How am i able to pass in the text of my … | |
Hi Everyone, I have a C++ program lesson, but i can't to do it. I have a binary file with structured datas. I have to read the datas, and take into a class (structure array). Here is my code: [CODE]#include <iostream> #include <fstream> using namespace std; struct dolgozo { char … | |
Question is: "Implement a Person class that includes data members to represent name, address, and identification number. The class interface includes methods that provide appropriate access to the data members. Derive a CollegeStudent class and a Professor class from Person. Each of these derived classes should add appropriate data members … | |
hey friends i am working with a program of "stack of stack".....and i thought to work it out using inheritance....but i m stuck in it... i thought to inherit both the stack - the parent stack and a stack element....from a single base class.. i mean i am in dilemma … | |
Just been looking over Dynamic Memory Allocation, using new. Heres a snippet of the code i've got. [code=c++] vertices = new float *[v]; for (i = 0; i < v; ++i) { vertices[i] = new float[3]; } [/code] what i was thinking was could i just do [code=c++] vertices = … | |
hi to everyone, In this semester we are having a class concerning High Performace computing / Parallel processing... In short i have the following questions: --- We are using pthreads and C. I think that i can use pthreads in c++ code but is there any way to use threads … | |
Am trying to extract a string of characters and numbers from a text file into two different data types in a linked list...i.e the if the text file has the data myname 100 i want the "myname" to be stored as a string and then the 100 as an integer..can … | |
Hi , I am using openRTSP test program. In the make file i used debugg option. But when i tried to debugg for example : "b 320", i got the following error. No line 24 in file "init.c". I don't know about this error. But gdb is working fine. For … | |
I'm a beginer in C++, and I've read number of posts regarding reading CSV files but have not understood how to convert them in to an array my file reads just numbers that are seperated by tabs 23 34 67 78 45 56 89 90 23 45 79 23 33 … | |
Hi, i have a function which is supposed to compare two matrices, however i does not work properly. I get this compile warning. [code] warning: control reaches end of non-void function [/code] Here is the function. [code=c++] bool matrix::isequal(const matrix& ob3) { for (int i = 0; i < rows; … | |
Hi, I'm not sure if this is the right thread, but here goes. I have a program installed which shows the live price of a product i am interested in (i.e. the price changes every couple of seconds). Now I cant access the programs source code to get the price … | |
hello, I have the following problem I have an unsigned long variable, but it is designed to hold values within 0 .. 100 ( I know an unsigned char would have been enough, but i have to use an unsigned long ). I have to write that value in a … | |
Hello I have an abstract class called Number and a simple derived class called Double, which has a private variable value and a function called getValue() which returns the value; I also have a vector of pointers of type Number which are pointing to Double. code: [code=c++] ... vector<Number*> v1; … | |
Question is: "Write a complete program that writes into a file from an array of string and also in reverse order." Please help | |
I am trying to write a program that takes email addresses out of a text file (for easy copy paste) but when it finds one and prints it to the console it skips to the next line. So if there are two email addresses in one line it will only … | |
I've posted something along these lines before, but it's a tad bit different this time, hopefully some of you can point me in the right direction. I'm designing a tool that will make adding things to a database easy for people not familiar with SQL, it will basically export a … | |
So I'm trying to create 4 arrays with data input from a .dat file, and for some reason it won't. The file has four columns, and I want four arrays with the info from each column seperate. For some reason, I'm having trouble doing that with the following code (minus … | |
//person class class Person { //private: public: char name[30]; char type[20]; char date[10]; char id[10]; Person(char pname[],char ptype[],char pdate[],char pid[]); void addPerson(); void personDelete(); char personFind(char pid[]); }; //this function find with id and return the name of the person char Person::personFind(char pid[]) { fstream readFile; readFile.open("employee.txt",ios::in); if(readFile.fail()) { cout<<"Cannot … | |
Hello All, I new to this forum and C++. Searched a lot on the web, but could not find help anywhere. I have two directories under each of which, I have multiple .cpp files. Each of the directories have a one .h include file that contains function declrations for all … | |
I have a problem with sorting a vector in a specific order. As seen below I am putting 4 strings into a vector like this. The result of the sorting that I am after is like this: (Highest Value at the top and the Lowest Value at the Bottom) [B]20A … |
The End.