49,757 Topics

Member Avatar for
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
248
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
256
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
115
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
109
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
650
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
Member Avatar for opposition

could someone please show me how i would be able to reverse the printout of a linked list?, i have gotten it to print out in the right order but not sure how to make to printout in reverse. here is my current code, [CODE] void print(node*& head) { node* …

Member Avatar for opposition
0
82
Member Avatar for sauna

[code=cplusplus] #include<stdio.h> #include<math.h> #define max 100 double f(double y); int k, i; double y[max]; double x[max]; void copyarray(double[], double[]); main() { FILE *file; double h, x, y; printf("this program does a first order ODE for dy/dx=-y+1 with initial condition of y(0)=0 from x=0 to x=0.9\n"); printf("input the step size (h>0):\n"); …

Member Avatar for ArkM
0
107
Member Avatar for the universe

Hello, Does anybody know how to write a command to generate a random array (let's say with 100 numbers) that contains numbers from a function that goes like y = x exp (2.5). where the range of x is given. I hope that my question is understandable :-) Thank you,

Member Avatar for VernonDozier
0
142
Member Avatar for skatamatic

Ok, so I'm trying to prove to my teacher that Div and Mod isn't always the best way to solve things. So i created this tiny program, held entirely in main.cpp : [CODE=cplusplus] //Project: Mod_Efficiency //Author : Kyle Wesley //Descrip: This was made to prove that mod/div operations are often …

Member Avatar for skatamatic
0
3K

The End.