49,761 Topics

Member Avatar for
Member Avatar for margeaux54

ı could not solve non lvalue assignment problem in this example I thought for long time but ı could not find any answer if you can help me , ı would be very happy include <iostream> using namespace std; void encyrpt(void); void decyrpt(void); void menu(void) { char a; cout<<"(E/e) Encryption"<<endl; …

Member Avatar for margeaux54
0
148
Member Avatar for viki_chennai

This is a singlylinked list code.This shows no error but while execution it shows singlylinkedlist.exe has encountered a problem and needs to close thanks in advance [code] #include "singlylinkedlist.h" #include <iostream> using namespace std; class singlylinkedlist //class for linkedlist { private: struct node //struct daclares the abstract data and link …

Member Avatar for Moschops
-1
131
Member Avatar for DLKenji

Alright guys, I'm in quite a situation. I have a project for school to create an application in C++ that can create and generate shopping dockets/receipts. This includes being able to add the names of the items, the prices, and then finding the total price of the purchase. We can …

Member Avatar for WolfPack
0
705
Member Avatar for TheFueley

I'm having trouble figuring out how to use exceptions to check if a file stream was created successfully. I know I can use if statements, but how do I do this using try/catch statements? It compiles successfully but it gives me an error when I supply a non-existent filename as …

Member Avatar for TheFueley
0
8K
Member Avatar for lochnessmonster

class stinker { private: int *pointer; int age; public: stinker() : pointer(), age() { ;} }; if i don't pass a value to my variables in an initialization list, do they automatically get initialized to 0?

Member Avatar for vijayan121
0
153
Member Avatar for failbot

I recently wrote an implementation of STL Vector as a programming exercise. The program compiles but I receive a strange error saying: [CODE] terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc [/CODE] I've never come up with this error before and am not sure what exactly should be …

Member Avatar for vijayan121
0
2K
Member Avatar for xCrusade

Hi, I have been working on this program for a few days.. and I am so far gone I lost myself in my own program. I usually just start from scratch when I get frustrated but there is too much time invested into my heap to give up so I …

Member Avatar for xCrusade
0
1K
Member Avatar for plang007

I do not know how to write a function for this. I have written just the base line of the code, but I do not know how to finish it. Here is the description. A void Function tagReader inputs the data collected by the cylinders; it has two parameters: the …

Member Avatar for plang007
0
240
Member Avatar for yeahyeah85

Hi guys, I am trying to modify my program so that when i entered an invalid number, it will say that this is invalid and loop me back to the starting point. I just cant find the point to do that. either it will just say invalid and continues, or …

Member Avatar for jonsca
0
180
Member Avatar for shantanusinghal

[code=c] int i=0,j=0; char operand[30]; char lbl[20],opr,num[20]; while(i<30) lbl[i]=num[i]=operand[i++]=NULL; cin>>operand; for(i=0; operand[i]!='+' || operand[i]!='-'; i++) lbl[i]=operand[i]; opr=operand[i++]; while(operand[i]!=NULL) num[j++]=operand[i++]; [/code] ..is there any mistake in this piece of code, my execution is getting stuck at [code=c] lbl[i]=operand[i]; [/code]

Member Avatar for Ancient Dragon
0
102
Member Avatar for winecoding

After running the following code segment, the output is Outer. Inner. Inner. [CODE] #include <iostream> using namespace std; namespace Outer { void message( ); namespace inner { void message( ); } } int main( ) { Outer::message( ); Outer::Inner::message( ); using namespace Outer; Inner::message( ); return 0; } namespace Outer …

Member Avatar for Ancient Dragon
0
72
Member Avatar for pg5678

May seem like a stupid question but can an array call a function? and if so is it possible to select an array from user input, so if the array was something like Num[10] and the user would input 6, it would then select Num[5] and call the function associated …

Member Avatar for gerard4143
0
145
Member Avatar for RapidFire4Life

Hi I'm having a lot of trouble with this problem. Here is the assignment... Write the definition of the function template seqSearch to implement the sequential search on a vector object. [CODE] template<class elemType> int seqSearch(const vector<elemType> &list, const elemType& item); //If item is found in the list, return the …

Member Avatar for RapidFire4Life
0
965
Member Avatar for determine

I just reconstructed my new code and am having trouble. When I try to compile it I keep getting an error message. At the end of the program something is wrong, but I can't figure it out. [code]#include <iostream> #include <cmath> #include <string> using namespace std; int main () { …

Member Avatar for determine
0
412
Member Avatar for TheWolverine

Hi all, I've got quite a simple question and after searching here and on other websites I can't seem to resolve what the "correct way" of doing this is in C++. Below is a simple piece of code illustrating what I am trying to do: [CODE] #include <iostream> class BaseClass …

Member Avatar for TheWolverine
0
349
Member Avatar for determine

How would I create a simple loop so that the person using this program (user) can keep inputting weights until they want to quit. Also, I need trying to create a limit that the user can only enter in a certain range of numbers in the input. I want the …

Member Avatar for frogboy77
0
122
Member Avatar for Transcendent

<S> --> <A><B> <A> ---> a | b <B> ---> 1 | 1 <B> It's suppose to start will a or b and 1 afterward. it doesn't matter how many 1's are after a or b. [CODE]/* <S> --> <A><B> <A> ---> a | b <B> ---> 1 | 1 …

Member Avatar for Transcendent
0
123
Member Avatar for ChristinaS

Hello and HELP!!!! I'm in CSC250. I'm writing a prog that needs to do the following: 1- read files from the directory, avoiding sub-directories (along w/ _chdir) 2- read the contents of the file (as binary) 3- extract info from the files 4- modify the file name to reflect info …

Member Avatar for WolfPack
0
412
Member Avatar for dvongrad

I'm not sure how to title the question I have so I can't be certain this hasn't been answered before. That said, following is a description of my programming question. I have a class R containing 2 integer elements, say X and Y. I then have two 24 element arrays …

Member Avatar for dvongrad
0
304
Member Avatar for Infame

Hi! I have a server which alows 5 clients to connect to it. I was wondering if it's possible to get their IP, or someother form of ID that sets them apart... I need it so I can assign names, and 'bannish' certain users. Thanks!

0
55
Member Avatar for fpsasm

Hello, I've made a program that uses an array of objects, it's work well so far, upto the point that I try to increase the size of an array. So, in main the relevant code loops like this: [CODE]int main(){ /* classes used */ phoneBook *p; .... numLines = 0; …

Member Avatar for fpsasm
0
335
Member Avatar for Skul'l

im trying to make a program with win32 GUI and im having trouble getting this to compile. Here are the errors im getting [QUOTE]D:\Documents and Settings\Skull\Desktop\Dorzon\main.cpp||In function 'BOOL DialogProc(HWND__*, UINT, WPARAM, LPARAM)': | D:\Documents and Settings\Skull\Desktop\Dorzon\main.cpp|57|error: 'ShellExecute' was not declared in this scope| ||=== Build finished: 1 errors, 0 warnings …

Member Avatar for Skul'l
0
522
Member Avatar for determine

I keep getting an error message when running my code at the end. I think it has something to do with line 26, but I'm not sure how to correct it. the error is sh: PAUSE: command not found My code is attached. Thanks for help in advance. [CODE]#include<iostream> #include<cmath> …

Member Avatar for determine
0
4K
Member Avatar for sgw

What is the difference between these two types of assingment? (a) [CODE]string color("red"); [/CODE] (b) [CODE]string color="red";[/CODE]

Member Avatar for arkoenig
0
122
Member Avatar for Frederick2

Could someone familiar with command line compiling using GNU C/C++ Compiler Collection please help me with a Dll creation problem I have? What I would like to know is how to create a Windows Dll out of the following very simple test file that is essentially just a "Hello, World!" …

Member Avatar for Frederick2
0
667
Member Avatar for kevinn

I'm making a project with OpenCV about tracking. But what I want is the ability to let the user import his own tracking algorithms. Is there some way that i can check in a specified folder if there are new algorithms added and how can I include them in my …

Member Avatar for kevinn
0
205
Member Avatar for determine

I want to set precision to 2 with the results. Does that mean that I have to put << setprecision (2) << after every weight on each planet or is there something easier I can do? [code]#include<iostream> #include<cmath> using namespace std; int CheckWeight(int weight, string Planet); int main() { int …

Member Avatar for determine
0
139
Member Avatar for Crutoy

Hello , i'm trying to solve a problem Tower of Hanoi recursively. I'm having problems with coming up with logic how to treat disks in terms of value. Lets say i have 3 disks how should i assign values to them ? My function is supposed to be defined such …

Member Avatar for Crutoy
0
203
Member Avatar for anu07

This is my computer science project,we were told to make any software we wish to make,so I thought about making a calculator,below is the code,but it doesn't seem to be functioning well,could anyone help and tell me what went wrong(I am using borland cpp 4.5 compiler,this program uses getch() to …

Member Avatar for anu07
0
186
Member Avatar for DilanShah

I have tried several things, but I just can't work out how to do this, so perhaps someone could help me here. This is an example taken from [url]http://www.gnu.org/software/gsl/manual/html_node/ODE-Example-programs.html[/url] on how to carry out integrals. [CODE] #include <stdio.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_matrix.h> #include <gsl/gsl_odeiv.h> int func (double t, const double …

0
81

The End.