49,757 Topics

Member Avatar for
Member Avatar for Jennifer84

I am trying to convert the std::string Number3 = "0.31" to a double in the code below. I have used a MessageBox to show the result. What happens is that double Convert is returning the value of: 0 What I have discovered is that if I instead would have written …

Member Avatar for Jennifer84
0
107
Member Avatar for CBnewbie

I need some help figuring out how to remove duplicates from an array. I've been working on this for a few days now, and every time I think I'm getting close, it just causes my program to shut down. I've gt a text file with city names in it and …

Member Avatar for VernonDozier
0
2K
Member Avatar for jfran

Firstly, in my own defence I should point out that I'm something of a novice at C++. Any help with the following would be gravelly appreciated. I have a C++ class that holds an internal array of ints. E.g: class MyClass { public: ....... //lots of methods here private: #define …

Member Avatar for jfran
0
92
Member Avatar for saadmalik

iam having problem in displaying the elements present in singly linkllist.here is my code below plz check the whole code and pointout the errors and give their solution plzzzzz. [CODE] #include<iostream.h> #include<conio.h> #include<stdlib.h> struct node { int data; node *ptr; }; node *first,*p,*nn; class list { public: void inslast(int); void …

Member Avatar for Prabakar
0
96
Member Avatar for CoolGamer48

Hey, am I correct in assuming that when you declare a function virtual in a prototype, it is illegal to use the virtual keyword again when you define the function?

Member Avatar for Prabakar
0
49
Member Avatar for perfectstranger

I have a dfa program that gets DFA's properties from a text file and tries given string is accepted or rejected by dfa. I have some problems and can't get rid of this. Can anybody help? Here is my code. [code=cplusplus] #include <cstdlib> #include <fstream> #include <iostream> #include <string> #include …

0
80
Member Avatar for aymeba

Hi, I'm a Student in Vienna TU. May you help me , what's Linear Hashing,and how can i it with c++ use? I need to help on adding and searching. Ich have some Documents on Internet founded but i didn't understand them. How can i Buckets split and Which Array …

0
45
Member Avatar for dan_e6
Member Avatar for William Hemsworth
0
79
Member Avatar for deathevan

hi all im new to this forum and i need some help with making a windows explorer in mfc. i dont expect that some1 makes one for me, but i dont know how to get started. my friend told me to make it with a treewiew and a listwiew control, …

Member Avatar for deathevan
0
128
Member Avatar for c++ newbie

hi. i'm trying to run my program but i get this error message... cannot convert âstd::stringâ to âstd::string*â for argument â1â to âvoid change(std::string*, int)â ...does anyone know what it means and where i am messing up?

Member Avatar for Ancient Dragon
0
66
Member Avatar for hezfast2

Hello again, I'm trying to finish a function I am working on that reads data from a file set up like: itemID itemName pOrdered manufPrice sellingPrice itemID itemName pOrdered manufPrice sellingPrice ....and so on and puts the data into vectors this is what I've gotten so far and I'm not …

Member Avatar for VernonDozier
0
220
Member Avatar for want_somehelp

Can somebody tell me what is the difference between static class and static local variable in C++ ? u will be greatful if u explain it giving example thanking you

Member Avatar for vijayan121
0
447
Member Avatar for r30028

I'm having some trouble getting the shortened integer value of a fairly long double value. The double value in question is "1234567890123457024". When taking the int of it, such as: [CODE]int(value);[/CODE] This value is giving me a result of -2147483648, which is completely illogical due first to the fact that …

Member Avatar for vijayan121
0
196
Member Avatar for light_handle

I have a text file that I want to tokenize(Separate the words) into a structure defined as [code] typedef struct { int fileno; char word[30]; int position; }storagefile[10000]; [/code] I want to be able to accesses each word, its position and the file it is in. Can anyone tell me …

Member Avatar for Ancient Dragon
0
63
Member Avatar for daniel88

Hi guys, I posted earlier today and had my problem resolved in record time, which was great as I had been struggling with the final elements of an assignment. Having received a preview automarking I found that I had one small error. Essentially, the read() function which follows takes an …

Member Avatar for daniel88
0
102
Member Avatar for ThunderSnow

I am working on a project for school. I read the book but I'm still having trouble getting my program to function. We are working with multisets and are using 3 files. We have a multiset.h header file that is only supposed to contain the class definition. This was given …

Member Avatar for Lerner
0
82
Member Avatar for Lotus_2011

This is my code to convert from binnary to octal ......what is the logic error in my code? [CODE]void main() { double base=2; char bin[10000]; int res,sum=0; cout<<"Enter the binnary number:"; cin>>bin; int len; len=strlen(bin); int coun=0; for(int i=0;i<len;i=i+3) { for(int j=0;j<3;j++) { res=bin[i]-'0'; sum=sum+res*(int) pow(base,j); } cout<<sum; } }[/CODE]

Member Avatar for William Hemsworth
0
136
Member Avatar for noraantonia

Hi, I have a question about the glut functions in opengl. For example, glutSolidTeapot (GLdouble size) Can anyone tell me if the rendered teapot can be textured and how? I applied textures on gluCylinder or gluSphere very easily : [code] GLUquadricObj *quadratic; // Storage For Our Quadratic Objects quadratic=gluNewQuadric(); // …

0
69
Member Avatar for Moporho

I am trying to switch this if...else statement to a Switch and I can not get the program to calculate. Please help? original if, else [code=cplusplus] #include <iostream> using std::cout; using std::cin; using std::endl; #include <iomanip> using std::setw; int main () { int x, total=21; cout << "Input Number for …

Member Avatar for Moporho
0
110
Member Avatar for En1ro

The problem is that i need to save in simple way the array of structure: [ICODE]struct gydytojas { int gydid, amzius, specialyb, telefonas, asmkod; String vardas[25]; String pavarde[35]; String adresas[50]; }; gydytojas gydmas[100];[/ICODE] This is the struct & array. Code: [ICODE]gydytojas pgyd; pgyd.vardas[25]=Edit21->Text; pgyd.pavarde[35]=Edit22->Text; pgyd.adresas[50]=Edit24->Text; pgyd.asmkod=StrToInt(Edit23->Text); pgyd.amzius=StrToInt(Edit27->Text); pgyd.gydid=StrToInt(Edit26->Text); pgyd.telefonas=StrToInt(Edit25->Text); pgyd.specialyb=ComboBox5->ItemIndex; …

Member Avatar for mitrmkar
0
94
Member Avatar for lianaconda

Hi. The assignment is to implement a function using recursion. I can't use any loops whatsoever. The function takes in an array of doubles and the array size, and is supposed to return the position of the smallest element in the array. I've already written some code out for the …

0
56
Member Avatar for n3XusSLO

hello, i started learning c++ on my own from internet tutorials, so i know "the basics" (pointers, classes,...) but i think that i missed some "small" but important stuff. i've been looking for some books on amazon but i can't decide which one to get. i want something that is …

Member Avatar for n3XusSLO
0
98
Member Avatar for lahom

hi [B]Could someone please tell me how can i open a txt file with a press of a button (MFC)? [/B] not with the infile >>> i mean [B]open "text file"[/B] and another question if i may.... [B]Is there any way i can transform a cpp file to a txt …

Member Avatar for lahom
0
139
Member Avatar for Lotus_2011
Member Avatar for Lotus_2011
0
329
Member Avatar for daviddoria

I have some code like this: [code] vector<double> Saved; for(int i = 0; i<10; i++) { if(some condition on i) Saved.push_back(i); } [/code] Then I want to see what order the things were saved... so naturally I do cout << Saved.at(0) << endl << Saved.at(1) << endl; But to my …

Member Avatar for mitrmkar
0
190
Member Avatar for acardiac

Can anybody please help me out in solving these problems in C++ Please reply to this thread ASAP! Thnx and regards acardiac Q.1. Write a program that accepts a nonnegative integer n and base b and display the digits of base-b representation (in reverse order) for each integer using a …

Member Avatar for acardiac
0
246
Member Avatar for eaglehorse

I am new to programmiing and I am starting to learn C++ but I have a question about the differences between programming C++ in windows and Linux? I ask because the book I have covers Windows but I alos want to learn any differences for linux as I have a …

Member Avatar for Radical Edward
0
91
Member Avatar for En1ro

In Unit1.h private: [ICODE] struct gydytojas { int gydid, amzius, specialyb, telefonas, asmkod; String vardas[25]; String pavarde[35]; String adresas[50]; }; gydytojas gydmas[100];[/ICODE] Now in Unit1.cpp im trying to do simple thing: [ICODE]void __fastcall TForm1::Button18Click(TObject *Sender) { gydytojas.vardas=Edit21->Text; gydytojas.pavarde=Edit22->Text; gydytojas.adresas=Edit24->Text; }[/ICODE] Getting these errors: [C++ Error] Unit1.cpp(172): E2108 Improper use of …

Member Avatar for En1ro
0
2K
Member Avatar for elementz

Knowing basic PHP and basicVisual Basic I have decided to move onto C++. I only know the basics of PHP and Visual Basic, I never decided to get to know both languages better. I could do little with PHP as it requires a web server to test it and Visual …

Member Avatar for elementz
0
164
Member Avatar for bhups40

this is my assignment and i also have tried to do this assignment and could not further proceed. please help. i will be very glad to here from you.[ATTACH]5921[/ATTACH] [ATTACH]5922[/ATTACH]

Member Avatar for bhups40
0
116

The End.