49,761 Topics

Member Avatar for
Member Avatar for Suetan

Here's my problem. I'm writing a program that has the user input a string. That string is then compared to the values in a string array within a class. Here's a sample of what I'm trying to do (sorry about the spacing. I use tabs, not spaces): This is my …

Member Avatar for Suetan
0
233
Member Avatar for rkumaram

Hi I have created a small program which just adds two char* with the help of overloaded + operator, but getting problem with destructor. [CODE] #include<iostream> #include<string.h> using namespace std; class base { private: char* name; public: base(); ~base(); void display(void); base(const char*); base(const base&); base operator+(base foo); }; base::base() …

Member Avatar for rkumaram
0
111
Member Avatar for kimn

Hi all. I've written a bit of code to open a file and read from it. The simple version works: [code=cplusplus] ifstream conFile("code/constants.h", ios::in); while (getline(conFile, line)) { //etc. Process file.......... [/code] However, I really want the program to look for the file constants.h in the current directory and if …

Member Avatar for kimn
0
57
Member Avatar for Prabakar

I have wrote a simple program in c++ that will constantly read a record from a database. Once there is a change in a field the program will open a executable file. An instance of this program or a copy of this program has to run in [B]at least[/B] 80 …

Member Avatar for Prabakar
0
255
Member Avatar for daviddoria

I need to do something like this: [code] ifstream infile(Filename.c_str()); //ifstream infile(Filename.c_str(), ios::binary); string line; ///////////// Read Header //////////// //read magic number getline(infine, line); while(line[0] == "#") getline(infile, line); MagicNumber_ = line; //more ascii stuff ...... //start reading binary data int m; infile.read(reinterpret_cast < char * > (&m), sizeof(m)); [/code] …

Member Avatar for Narue
0
122
Member Avatar for pramen

please solve the following c++ programs. I will be higly thankfull. [B]Please See thar b= Space[/B] 1) bb* bb b***b ***** 2) bbb*bbb bb***bb b*****b ******* b*****b bb***bb bbb*bbb Please reply quickly anyone.

Member Avatar for iamthwee
0
50
Member Avatar for alexvena

The problem: Will not compile, i get the following errors: "invalid conversion from char to char*" "invalid conversion from char to const char*" Program Description: Opens a file and read each character into a linked list [code] #include <iostream> #include <fstream> using namespace std; const int MAX = 30; struct …

Member Avatar for mshahid
0
81
Member Avatar for ragaven

Hi.... I have started a [B]client terminal [/B]application. It displays the text received from the server. But once I locked the computer and again unlocked it, the text in the terminal disappears. I could see the text only after pressing enter or any other event. I want to know Is …

0
52
Member Avatar for reshma.mane

Hi All, I want some interesting Advanced data structures problems. Could you please let me know the link or the actual problem statements? If possible, you can send some hints to solve that problem. This would be very helpful for me.

Member Avatar for Alex Edwards
0
99
Member Avatar for jkuboschek

Hey guys, I've done some google searches today but didn't find a clear cut answer to this. I've got a function that I would like to return an array of strings. Any ideas anyone?

Member Avatar for jkuboschek
0
157
Member Avatar for nano99r

Hi, I have to create this program and I am having difficulty doing it. Develop a Visual C++ program that will determine whether a department-store customer has exceeded the credit limit on a charge account. For each customer, the following facts are entered via a keyboard: a. Account number (an …

Member Avatar for VernonDozier
0
182
Member Avatar for rugs267

Hey Everyone! I'm having trouble with a C++ program I'm trying to write. I need to input a text file into a 2D array and sort it into 13 rows, 5 columns using strtok. I need to use strtok because some of the words are separated by ws, others by …

Member Avatar for rugs267
0
249
Member Avatar for BeyondTheEye

I made a win32 application in Visual C++ 2008 using the Windows Forms Application. But for opening files, and saving eventually, havn't gotten to it yet, I was creating some basic classes in other files. The odd thing is the [i]stdio.h[/i] file seems to be working differently in VC. I …

Member Avatar for Narue
0
262
Member Avatar for mostermand

hi i was wondering how much i should use classes in C++. Should i use it as much as possible?

Member Avatar for mostermand
0
289
Member Avatar for pads

Hello everybody I am from Commerce Background doing some IT stuff got some problem by professors.. Can someone solve this problem thanks.. Program Specification: “The body mass index (BMI), or Quetelet index, is a statistical measure of the weight of a person scaled according to height. The body mass index …

Member Avatar for MelechM
0
147
Member Avatar for MelechM

Ok I have Visual C++ 2008 and I made a new project and made an app. It's a basic window with a menu, icon, etc. Now I have the following program for instance: [code] #include <iostream> #include <math.h> using namespace std; int main() { char answer; float c, e, x, …

Member Avatar for MelechM
0
110
Member Avatar for Nemoticchigga

How would one seperate a decimal into 2 numbers, the left and right sides of the decimal? float example = 131.14567 into... int left = 131 float right = .14567 thanks.

Member Avatar for ArkM
0
116
Member Avatar for castrohe

I want to insert and order 3 objects (from different classes) in a priority queue. I create an array to access to the element inside the priority and then I push in the priority queue. The code: [code] #include <iostream> #include <queue> #include <vector> using namespace std; class Alumnos{ public: …

Member Avatar for ArkM
0
110
Member Avatar for Ancient Dragon

Has anyone been able to compile the lib files using Microsoft Visual C++ 2008 Express compiler? I downloaded and installed MySQL 5.0 Server yesterday, then downloaded MySQL++ source. Attempted to compile and got a bunch of link errors. I used dumpbin.exe to get a list of all the symbols in …

Member Avatar for mitrmkar
0
165
Member Avatar for mohit_t

Hi, I have a C++ program which creates a xml file from a given data. Now I have to upload that file to a web server. I need to make a socket connection to the server and upload the file to a http server. The server where the file needs …

Member Avatar for Ancient Dragon
0
84
Member Avatar for Dannyo329

I just knew about getch() and found it better than cin (a lot) but there's one problem bugging me, can you makea n if statement for getch()? For example they have: [CODE] int a; cin >> a; if (a == 1) //blah else if (a ==2) //blah else //blah [/CODE] …

Member Avatar for Dannyo329
0
651
Member Avatar for smileeok

I have a question about the memory allocation of class. My compiler is GCC 4.1.2. I define a class called Foo, create three objects of it, and have a look at their addresses. Following is my code: [code=c++] class Foo { int k; }; int main() { Foo f1, f2, …

Member Avatar for ithelp
0
135
Member Avatar for super_beda

Hi DaniWeb team, I had to import in .NET a DLL with a function that takes as input some CString arguments. So I developed a little wrapper dll for this function containing an unmanaged function that takes as input some const char*,"translates" them into CString and then passes them to …

0
60
Member Avatar for aussie_chick

G'day everyone, I need to fill a 2day which is passed as an argument that is able to store the height and weight of 5 volunteers. The function I need to do this in needs to prompt the volunteers for their height and weight. Could anyone please give me a …

Member Avatar for aussie_chick
0
3K
Member Avatar for john88

I dont know why this doesnt work, basically I want to calcualate the letters and numbers and white spaces and so on, nothing fancy. And it does work, it does calculate everything. However I seem to be stuck in the while loop or something because I cant print it out, …

Member Avatar for MelechM
0
120
Member Avatar for Emerald214

I don't understand why **ptr is used in this code. Please expain to me. [code] template<class NODETYPE> void Tree<NODETYPE>::insertNode(const NODETYPE &value) { insertNodeHelper(&rootPtr, value); } template<class NODETYPE> void Tree<NODETYPE>::insertNodeHelper(TreeNode<NODETYPE> **ptr, const NODETYPE &value) { if(*ptr == 0) *ptr = new TreeNode<NODETYPE>(value); else { if(value < (*ptr)->data) insertNodeHelper(&((*ptr)->leftPtr), value); else if(value …

Member Avatar for ArkM
0
113
Member Avatar for jgalewsk

Hello, I need some help with some code I have. The compiler is giving me weird errors and I am not sure how to fix it, especially because I dont see anything wrong with the way I wrote my code. It has to do with array of structs and declaring …

Member Avatar for v1d1t
0
202
Member Avatar for ohyeah

I don't mean "iostream.h" or missng "return 0;". I wonder why don't run like it should but shows "press eny key continue"? [CODE]#include <iostream.h> int n,m,result,br=0; int a[100][100]; int jj=0; void main() { cout<<"n?"; cin>>n; cout<<"m?"; cin>>m; for(int i=0;i<n;i++) for(int j=0;j<m;j++) { cout<<"a["<<i<<"]["<<j<<"]="; cin>>a[i][j]; } for(int ii=0;ii<n;ii++) for(int jj=0;jj<m;jj++) { …

Member Avatar for MelechM
0
152
Member Avatar for architact

Hello Guys please tell me what are the differences between Object Oriented and Structured Programming. Thanks.

Member Avatar for Ancient Dragon
0
71
Member Avatar for bricjames

I am working on a program that will have the user input two numbers ....the program then adds them together and prints out the sum.....the program is to then ask if you want to continue...the user is to type in y or n....how do i go about having the program …

Member Avatar for MelechM
0
120

The End.