49,761 Topics

Member Avatar for
Member Avatar for Iamthedude

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() { …

Member Avatar for jonsca
0
162
Member Avatar for smeghead007

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 …

Member Avatar for smeghead007
0
136
Member Avatar for fugnut

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 …

Member Avatar for jonsca
0
113
Member Avatar for robski

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 …

Member Avatar for Iamthedude
0
102
Member Avatar for acos.carlos

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 …

Member Avatar for acos.carlos
0
50
Member Avatar for Nick6425fl

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 …

Member Avatar for DawnDenise
0
320
Member Avatar for pinknblu

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 …

Member Avatar for pinknblu
0
338
Member Avatar for PDB1982

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 …

Member Avatar for jonsca
0
97
Member Avatar for Jeff_5_7

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 …

Member Avatar for Jeff_5_7
0
102
Member Avatar for fugnut

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; …

Member Avatar for fugnut
0
96
Member Avatar for blackmagic01021

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 …

Member Avatar for WaltP
0
101
Member Avatar for Alviery

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 …

Member Avatar for anup375
0
98
Member Avatar for TheWolverine

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 …

Member Avatar for TheWolverine
0
2K
Member Avatar for tonyrockcakes

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 …

Member Avatar for tonyrockcakes
0
222
Member Avatar for mendheim2

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 …

Member Avatar for Jiwe
0
107
Member Avatar for pvsumanbabu

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 '-,:' …

Member Avatar for pvsumanbabu
0
105
Member Avatar for lighten123

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 …

Member Avatar for Salem
0
95
Member Avatar for acos.carlos

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 …

Member Avatar for acos.carlos
0
93
Member Avatar for timbomo

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 …

Member Avatar for Lerner
0
140
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
510
Member Avatar for italian

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& …

Member Avatar for mattjbond
0
1K
Member Avatar for Talguy

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 …

Member Avatar for Talguy
0
448
Member Avatar for Gribouillis

I'm looking for C++ libraries to manipulate real and/or rational polynomials. Does someone know such a library ?

0
132
Member Avatar for venkat arun

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 …

Member Avatar for venkat arun
0
291
Member Avatar for tajendra

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.

Member Avatar for ashishchoure
0
91
Member Avatar for yapkm01

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 …

Member Avatar for mattjbond
0
155
Member Avatar for ahsanabbasdogar

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]

Member Avatar for pecet
0
73
Member Avatar for vishalkbhatt

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 …

Member Avatar for vishalkbhatt
0
123
Member Avatar for pranay_agg

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 …

Member Avatar for kunal kislay
0
132
Member Avatar for hondros

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. …

Member Avatar for venkat arun
0
381

The End.