49,761 Topics
| |
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 … | |
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() … | |
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 … | |
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 … | |
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] … | |
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. | |
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 … | |
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 … | |
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. | |
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? | |
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 … | |
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 … | |
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 … | |
hi i was wondering how much i should use classes in C++. Should i use it as much as possible? | |
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 … | |
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, … | |
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. | |
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: … | |
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 … | |
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 … | |
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] … | |
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, … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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++) { … | |
Hello Guys please tell me what are the differences between Object Oriented and Structured Programming. Thanks. | |
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 … |
The End.