49,761 Topics
| |
| Hi, I've been trying to create an accessor for my class that returns an array of structs as well as another that returns just a simple char array, but I can't seem to figure out how to do it, I had assumed it would just be [CODE] Example_Struct Foo::GetStructBar() { … |
ok guys I need your help. Im still new to C++ and what I need to do is read a .txt file into an array. The file consits of number like this ie 345 55555 56788765 5444 333 22 3 55656757 etc.... then I need to sort them using the … | |
As part of an assignment, I am to create a function to complete the program....I am very new to arrays and would like a little help, code as follows [CODE]// NAME: // ASSIGNMENT: pj70101 - ComputeAverage Function // COURSE: #include <iostream> #include <iomanip> using namespace std; //========================================================= // put your … | |
Hi everyone. I'm new to the forum and thought it would be a good idea to come to the experts with some of my questions. I am currently trying to write a relatively simple program but being quite new to c++ i'm struggling with some things. I am trying to … | |
The specific problem is this: "For each course the user creates, there must be a file for that course". The functions to display and insert the students, grades and sex work, I'm just stumped on how to make a function allowing the user to create the course on which the … | |
| I'll post the question below but I can't get the smallest and largest to print. I'm not even sure I have the math correct to calculate them because I can't get results to print. A local zoo wants to keep track of how many pounds of food each of its … |
Question: how do i get the average to come out, correctly. The first avg., should be 85, next second one: 85.5, then student three: 80. Here's my code: [code]#include <iostream> #include <iomanip> using namespace std; void handleOneStudent(int N); int main() { int NumberOfStudents; cout << "How many students are in … | |
I can get my code to compile and produce correctly (as I want it right now), except for one problem: Output: [code]What Degree Polynomial: 2 Enter Coefficient #: 8 Enter Coefficient #: 5 Polynomial selected is: 8x^(0)5x^(1) What Degree Polynomial: 3 Enter Coefficient #: 4 Enter Coefficient #: 5 Enter … | |
Ok i am working on a program for class to add to big numbers. The numbers are entered as Chars then converted to int. Then i need to place them into a dynamically allocated array with a pointer. I need to do this twice to make two arrays and the … | |
I have a switch function in a program that needs a little help. The switch function is as follows [CODE]ostream& displayShapes( ostream& outfile, Shapes ashape) { switch( ashape ) { case Triangle: outfile<< "Triangle" ; break; case Circle: outfile << "Circle" ; break; case Rectangle: outfile << "Rectangle" ; break; … | |
I am trying to use file name as a parameter to a program in DOS. I know it can be done by changing the parameter to the main(). I do not understand the exact way. I have developed a data compression and decompression utility, it works for a particular file … | |
It happens that I am doing a project for my computer class, but it seems not to work. This is the project : An employee is paid at a rate of $16.78 per hour for the first 40 hours worked in a week. Any hours over that are paid at … | |
Hi all, This might be bit of a silly question, but it's stumped me now for over a day and I've scourged the net for info but haven't found anything to sort out what I should be doing. I am currently using Qt Creator 1.3.1 (Based on Qt 4.6.2 (32 … | |
hello i'm using C++ for the first time on my course after a year of c#. We are suppose to make a client and server using pre existing code. One file was server one was of a client. There must be 3 classes a common class/ base class and a … | |
I have been working on this for a very long time. I have also searched for examples but they do not help. Here is what i need to do...I need to take the students score and compare it to average and print out the corresponding grade. I am having a … | |
Hi, I have a Date field and DateTime filed as string variables. Now i want to customize their formats as like given below. Ex-1: 20091024 if i specify the seperator as '/' then 2009/10/24 '-' Then 2009-10-24 Ex-2: 200910241011012 if i specify the seperator as '/,:' then 2009/10/24 10:11:12 '-,:' … | |
For Making long description short see my case: [code] suppose, path: "../defult123/test.txt" my code: ofstream fout("../defult123/test.txt",ios::out); Here in "defult123", "default" is static but "123" is dynamic .So Basically path should be written as: "../default***/test.txt" [/code] So how can i access this dynamic path for writing in test.txt file. [code] so … | |
Fist of, I'm new hew as the post count shows, so hello. I had this homework where we had to make a program that works with arrays. With that there were little to no problems, but I wanted to make a function for the selection of the option in the … | |
im trying to practice on: Basic User Defined Functions/ Pass by Value Functions for class and im confused. this code has a problem with it, its not printing everyting i want it to say. can someone help me understand this and what i am doing what wrong and what i … | |
This is one mean function! I've tried everything I can think of. I registered a type library with LoadTypeLibEx() which is a really easy function to use. I mistakingly thought UnregisterTypeLib() would be routine. Its most decidedly not! The error I keep getting with FormatMessage() is... Error accessing the OLE … | |
Hi folks, this might come off as a silly question but here it is. If I have this code: [CODE]class CtrTest { public: CtrTest() { cout << "Ctr" << endl; } CtrTest(const CtrTest&) { cout << "Cp Ctr" << endl; } }; class Wrap { CtrTest test; public: const CtrTest& … | |
Can I use libxml++ to parse html. I'm trying to find all the images in a xml file and store the image data directly into the src attribute of the web page. I know there is a bit of a difference between html and xml that's why I am asking … | |
I'm looking for C++ libraries to manipulate real and/or rational polynomials. Does someone know such a library ? | |
Hello, I have made a program in C++ for which I am making the GUI in C#. I want to run the C++ program as a process from C#. The program loads and runs fine, but due to some reason it is not able to access the files. When I … | |
I am just looking for information about dump file created by windows on crash. Want to understand its working. Please share your knowledge about this topic, you can post to it or can give me reference links. | |
I have a Computer Science degree (long2 time ago) .. I do know Java OOP but i am now trying to pick up C++. I do have C and of course data structure using C or pascal. I have started reading Bjarne Stroustrup book (The C++ Programming Language - Special … | |
I am facing problem in output of this program it is not giving me correct output...pls help me to solve this program...[I]<<snip>>[/I] [CODE]# include<stdio.h> # include<conio.h> void main() { clrscr(); int q,year,j,k,m,month,a,b,c,d,e,f,h; printf([/CODE] | |
Hi all.. i have a program to count LOC i.e. Line of code of a source file of any C++ program. The LOC shud not contain the comments count and also the blank lines. Now i m able to count to total lines of the program but the comments and … | |
hi, i have a string like string s = "1234" and i want separately the integers 1 ,2 ,3 4 as integers , so how do i do it? i tried using atoi as follows : [CODE]char * ss[10]; ss = atoi(s.c_str()); int x = ss[0];[/CODE] for getting 1 but … | |
Okay, as the name implies, I would like to change an integer (ascii code number), such as 65, to a string, '65', then back to integer, 65. Now, the reason for doing so, is because I'm working with ascii code, and want to return a string of a fixed length. … |
The End.