49,757 Topics

Member Avatar for
Member Avatar for MylesDBaker

Hello everyone. I am trying to create a program that reads these values / strings from a file: 170 Lipstick 250 Orange Crush 350 Chickadee 450 Green Grass 550 Monaco 750 Toffee Crunch Then I am supposed to create a menu that prompts the user to provide either the number …

Member Avatar for MylesDBaker
0
149
Member Avatar for Dannielf

ok, so I just started looping today and the simpler programs are all right, but we got a pretty complex assignment which I am pretty lost on. here's the assignment: [I]Write a program that updates a person’s bank balance based on withdrawals and deposits. Ask the user to enter the …

Member Avatar for VernonDozier
0
160
Member Avatar for uncertainty

Im currently using turbo explorer as IDE, kinda new to it and was testing some functionalities and ended up trying to save and load images from MySQL. So I had this one to grab images from file to form: [code] void __fastcall Tcharacter::openClick(TObject *Sender) { OpenPictureDialog1->Execute(); EditBox1->Text = OpenPictureDialog1->FileName; Image1->Picture->LoadFromFile(EditBox1->Text); …

0
71
Member Avatar for monkey_king

I've been overloading some methods for a template class. This means I can write my code in this way. [CODE=c++] myClass var3=var2+4; [/CODE] Is it possible to do it the otherway around like [CODE=c++] myClass var3=4+var2; [/CODE] I know that the end result will be the same, I was just …

Member Avatar for monkey_king
0
145
Member Avatar for bbhe

Hi, I am trying to replace a few text strings in a text file (test.txt), and then makeing some spaces, for it to be easier to read Anyone have an example I can use, because I am new to C++ I just want to replace "word1" with red "word2", and …

Member Avatar for bbhe
0
149
Member Avatar for noadek

I'm working on a project graphical based authentication and i need to implement this with C++. I need to understand this concept and all the books i ve read, none has really explained it well. Please I need help and badly.

Member Avatar for Salem
0
180
Member Avatar for JackDurden

How do I input a string then output a vector from this function? The compiler doesnt seem to like "while(invector>>word)". [CODE]vector<string> example (string invector);//prototype vector<string> example(string invector) { string word; stringstream insert(invector); vector < string > vectemp; while(invector >> word) vectemp.push_back(word); for(int i = 0; i < vectemp.size(); i++) cout …

Member Avatar for Narue
0
119
Member Avatar for Malfunktion

I was wondering if anyone had some source code/snippets of code that can: - Move a a file (I guess copy -> paste -> delete old one) - Rename a file. - Locate whether a file is in a certain place? Im using XCode on a mac. Thanks

Member Avatar for Salem
0
36
Member Avatar for aloplop

Hello, I would like to know if I can invoke an applet method from C++. This method is loaded in a web browser. For example, the applet is called app and I want to invoke "app.Zoom(2)". Thanks.

0
51
Member Avatar for OnIIcE

Hello! I’ve started a project that allows users to edited wav files (flange, distortion) and but them in a sequence and make a loop. I want to be able to visualize the actual sound wave of the file (like if you dropped a sound file in Audacity (and then in …

Member Avatar for skatamatic
0
214
Member Avatar for masterjiraya

[B]filename:[/B] [COLOR="Red"]main.cpp[/COLOR] [CODE=cplusplus] #include <iostream> using namespace std; int main(); using namespace std; #include "BinaryTree.h" int main() { BinaryTree<int> tree[8]; tree[1].makeTree(1, tree[0], tree[0]); tree[3].makeTree(3, tree[0], tree[0]); tree[2].makeTree(2, tree[1], tree[3]); tree[5].makeTree(5, tree[0], tree[0]); tree[4].makeTree(4, tree[2], tree[5]); tree[7].makeTree(7, tree[0], tree[0]); tree[6].makeTree(6, tree[4], tree[7]); cout << "Preorder: "; tree[6].preorder(); cout << "\n"; cout …

Member Avatar for masterjiraya
0
149
Member Avatar for bonnie1702

Hi there! I am just starting out in c++ and so far, its going ok. I have a small problem in a simple program that is frustrating me, so I am hoping someone will point me in the right direction of where I've gone wrong. The program basically prompts the …

Member Avatar for bonnie1702
1
217
Member Avatar for Seba Sama

Hi everyone! I'm kinda n00b in C/C++, All I ever did were some basic programs for some .txt files manipulation. Last time I was working in BC 3.1, about for years ago. Now I got Borland Turbo C++ Explorer 2006 and is a little hard for me to start a …

Member Avatar for Sky Diploma
0
148
Member Avatar for kux

Compile this code with MSVC2005 [CODE] unsigned short x = 20; unsigned short y = 20; for ( unsigned long i = 0; i < x * y ; i++ ) { cout<<i<<endl; } [/CODE] and u get warning C4018: '<' : signed/unsigned mismatch why? i mean, it all runs …

Member Avatar for kux
0
131
Member Avatar for aloplop

Hi all, I have developed an application in C++ using Borland Builder 6. In this app I load a html file which contains an applet stored in a wifi robot so that in my app I receive the image from an IP camera installed on it. The fact is that …

0
55
Member Avatar for shamila08

Hello, dear all, here is my algorithm. i'm trying to reverse the array but its not function and not loop. [code=cplusplus] #include <iostream> using namespace std; void initial(int *v, int N) { int i; for(i=1; i<=N; i++) v[i] = i; } void write (int *v, int N) { for (int …

Member Avatar for Nick Evan
0
155
Member Avatar for dodo_ind

Hi all I'm using a 'STRING' variable to store the entire contents of a file. Is there any possibility of buffer overflow if the content of the file is large? (eg: say size of the file is 30MB). Thanks in advance

Member Avatar for Alex Edwards
0
199
Member Avatar for Hinche4

Hi guys, I'm new to this but I have no idea what is wrong with my code and I'm going insane trying to figure it out and its due very soon! I would appreciate any help you can give me! Here's my code: [code=cplusplus] #include <iostream> #include <iomanip> #define ROWS …

Member Avatar for ArkM
0
248
Member Avatar for defychaos

Hi friends :P I'm needing some help on an assignment. I'm really not sure about all the argument-passing and structure references I have been assigned for my C++ class. Any help is greatly appreciated. I'll continue to work on it in the meantime, but I cannot get it to compile …

Member Avatar for skatamatic
0
119
Member Avatar for vadan

HI I have created an object pool in shared memory each object encapsulates another object which in turn has a socket object which is a pointer Now my question is, should the socket object be created in the same memory region (using overloaded new) as that of pool object or …

Member Avatar for Duoas
0
98
Member Avatar for amt_muk

Hello Friendz, Suppose I have a program like [code] // A.cpp int main() { if(some_condition) return 1; return 0; } [/code] Now from another program I want to run the above program, like [code] //B.cpp int main() { ... ... system("A"); ... ... return 0; } [/code] Here how can …

Member Avatar for Duoas
0
370
Member Avatar for vadan

Hi I want to create an array as shown in the class below everything is working fine, but at the end of execution of the program, there is a memory fault Please help me in finding out the problem [code=cplusplus] class a { int i; int arr[]; public: a(); ~a(); …

Member Avatar for vadan
0
136
Member Avatar for wiz83

hi you please tell me how to call javascript files from c++ code?i know this(iam not 100% sure) that you first call html files,then from ther you call javascript files.

Member Avatar for ~s.o.s~
0
140
Member Avatar for Trekker182

I'm taking the time from an accessor function and if it's from 0-9, so it displays correctly the hour time position, I have the following statements in my main body: [CODE] if (clock1.getHour() == 00) cout<<"The hour of clock1 is 00"<<endl; else if (clock1.getHour() == 01) cout<<"The hour of clock1 …

Member Avatar for VernonDozier
0
4K
Member Avatar for JackDurden

How do I use a pointer with a 2-dim array? I am converting string to char array. char x[25][100]; const char* A= x; A= x.c_str();

Member Avatar for Ancient Dragon
0
102
Member Avatar for Dinomike1000

I have been working through the book [U]Windows Game Programming for Dummies[/U] and so far it has been excellent. I am about half way through the book and I am planning on finishing. However, the books is from 2002 and it uses DirectDraw7 for the graphics component of DirectX. It …

0
100
Member Avatar for tedobg

Hey guys.I am not sure that what I want to do is possible but if it is can someone help me out... Well I want towrite a program which waits for input for a curtain amount of time and if no input is received it continues its execution.I will be …

Member Avatar for tedobg
0
208
Member Avatar for volscolts16

I have a problem with the new program, it compiles and and it debugs, but when I get to the command lines and enter my function it gives me a debug assertion failure. We are supposed to be finding the sum of the area of rectangles used for close approximation. …

Member Avatar for skatamatic
0
100
Member Avatar for Jennifer84

I have put values into 6 elements of the vector Numbers like below. What I wonder is if there is any function to check for the Highest value for a given range of the vector. Say I want to find the highest value from elements [3] to [5] wich in …

Member Avatar for stilllearning
0
138
Member Avatar for Natrax

learning C++ and going through some codes. I'm puzzled by how the following piece of code works. It's from the msdn library as part of an example, and I know that the code works, but I'm puzzled by how the "%" sign works. [code=cplusplus] #include "stdafx.h" #include <stdio.h> int main …

Member Avatar for Natrax
0
73

The End.