49,757 Topics

Member Avatar for
Member Avatar for Fenrir190

[CODE] void readData(ifstream& file, char& operation, int& numOfData) // Purpose: To read data from a file specified by the user { file>>operation>>numOfData; if(operation == 'I') { Array<int>* array; array = new Array<int>(numOfData); } } [/CODE] That's where the problem is coming from. [CODE] const int DEFAULT_SIZE = 30; template <class …

Member Avatar for r.stiltskin
0
223
Member Avatar for amishraa

So I have calculated the total of students on all of their 6 grades but now I want to be able to calculate the average of all the grades and list the averages next to the total column. Any help would be greatly appreciated! [CODE] //preprocessor directive #include<iostream> #include<iomanip> #include<fstream> …

Member Avatar for cibaiciao
0
381
Member Avatar for Der_sed

How should I define the next() fucntion- LINE 69. For now the get_string isnt even fetching the string from the In_box //09030032 at lums [CODE] //====================================== //Stroustrup Interface Libray files //====================================== #include "Simple_window.h" #include "Graph.h" #include "GUI.h" #include "Window.h" #include "../std_lib_facilities.h" //====================================== //Load neccessary header files //====================================== #include <fstream> //to …

0
54
Member Avatar for confusedndazed

Hello guys....I appreciate any and all replies I get but I really needed to be [I]shown[/I] how to incorporate a program title and a function call into this code and have it properly execute. I am really lost with programming so I don't usually understand explanations unless I can actually …

Member Avatar for confusedndazed
0
100
Member Avatar for Snippset

Hi, I want to change words from a readed text file. To be more precisely, I need to change the date type in a text file to their representing digits. Example 2002 y. June mon. 1 d. is the given text. 02-06-01 is the output. So, any thoughts for getting …

Member Avatar for Lawand
0
94
Member Avatar for helixkod

current code: [CODE] void showMedian(int *array, int size) { double middle; double average; middle = size / 2; if ( middle % 2) { average = (*(array[middle]) + *(array[middle + 1])) / 2; cout << "The median is: " << average << endl; } else cout << "The median is: …

Member Avatar for cibaiciao
0
248
Member Avatar for Clinton Portis

I thought this website on coding conventions was pretty cool.. learned some things that I never knew before: [url]http://www.possibility.com/Cpp/CppCodingStandard.html#init[/url] I was just wondering: If there are any conventions in particular you agree or disagree with (and why) If this would be worthy of being a 'sticky post' as I think …

Member Avatar for Lawand
1
148
Member Avatar for pac-man

Quick q, What function takes precedence with a template function vs a non-template function? I set up the following code but my result had the following output Template Template even though a guide I read said it should read: Template Non-template [CODE]// Testing template function vs non-template function to see …

Member Avatar for mrnutty
0
109
Member Avatar for Snippset

Hi, I need to check if two provided words doesn't have the same letter in it. And as I just started with this text thingy, I don't really know much about. For starters I got this code: [CODE] if (strcmp(Z1, Z2) == 0) Memo1->Lines->Add("Z1==Z2"); else if (strcmp(Z1, Z2) < 0) …

Member Avatar for Snippset
0
167
Member Avatar for eduard77

I am trying to make a software that reauires a matrix like this 1 4 0.4 0.8 0.9 4 5 8 15 25 68 19 14 0.8 0.15 5 45 2 7 8 6 1 9 0 5 17 5 9 1 7 0.5 0.18 0.16 etc the matix has …

Member Avatar for Agni
-1
90
Member Avatar for gedas

hey everyone i have a task to write down the adjacency matrix of this graph and im a little unsure how it should look i hope there is someone that can help, thx in advance:-/

Member Avatar for Lerner
0
80
Member Avatar for squadjot

Hi, i'd like to start a commandline executeable, and then be able to read the content of the output it produces. - Im NOT looking for a Stdout function. Concider having a bat file with following content [CODE]ping google.au ping google.dk ping google.de ping google.se ping google.no ping google.fi ping …

Member Avatar for squadjot
0
122
Member Avatar for Cy137

I keep receiving the same output for each record when I run it on the test data. I've tried numerous things...any suggestions? I've worked on this for almost twelve hours straight, not counting previous work. I'm hoping one of you guys/gals who know whats going on can point me in …

Member Avatar for mrnutty
0
187
Member Avatar for sidra 100

can anyone guide me about the type of questions which can b asked in the paper of programing. i m student of mcs first semester.plz help me

Member Avatar for mrnutty
0
59
Member Avatar for guccitan88

I'm not understanding my assignment and what I've read has really confused me. This is what I need to do: write a function to initialize an integer Partially Loaded Array with distinct random values. The array has room for 50 elements. The actual number of elements to store will be …

Member Avatar for guccitan88
0
132
Member Avatar for Reimschmied

Hi all, Could someone help me? I have programm that reads xml file and displays it in window with StringGrid. I need to replace my code with a function that has xml file as a parameter and returns two-dementional array of strings (instead of StringGrid). You can see my code …

Member Avatar for Ancient Dragon
0
133
Member Avatar for grib

I'm attempting to use a specialized function to search an array of c strings for the longest (or first tied for longest) member. Right now, I'm getting [inlinecode]line 87 error: invalid conversion from `char' to `const char*'|[/inlinecode] on my comparison statement. If I switch the templates' inputs to const, I …

Member Avatar for DavidRead
1
123
Member Avatar for DweyneAnne

i have a homework for our programmin classes, i searched for other solutions regarding the gotoxy function, but all saw was for devc++, turboc++ and other IDEs, when i use the function for devc++ or turboc++, i know it wont work, but i tried it, says there's not library for …

Member Avatar for DweyneAnne
0
239
Member Avatar for grassboy

Hello... I've studied FIFO in recent days... and tried to write some code (Linux C) for practice... but there are some bugs in my code... I don't know how to solve it... here is my code... [code] #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> int main(){ char …

0
48
Member Avatar for ahsanmalik

Our teacher gave us this project and i have no idea about how to get started with it....can someone give me any guidelines about it please????!!!! "You are required to implement an “Online Testing System” which should be able to store questions along with their answers in the question bank …

Member Avatar for ahsanmalik
0
108
Member Avatar for Cy137

So far, this has worked relatively nicely. However, I am having trouble in outputting to two separate files, and I'm hoping that you guys and gals can help me out. I'm reading in from a file, and outputting to two different files, based on what the input is. If anyone …

Member Avatar for Cy137
1
181
Member Avatar for Spreegem

I had to develop a brute force, a recursive, divide and conquer, and transform and conquer algorithms for calculating the nth power of a, a^n, for an assignment. I got the first three done pretty easy but I'm completely stumped at how to do the transform and conquer algorithm. I've …

Member Avatar for Nimmy Chohan
0
177
Member Avatar for joshjgordon

I am trying to use pow in c++ and for some daft reason it is not working properly. I have used it before with no issues, so I am sure that there is just something that I am overlooking. here is what I have: [CODE] const double epsilon = cutoff_velocity …

Member Avatar for sidra 100
0
81
Member Avatar for muhammad zain

hi, I need help in adding questions in a program using strings, structures or array............. Plz help me n snd the code

Member Avatar for Clinton Portis
0
88
Member Avatar for Rockdrummer357

So, I need to make a binary tree, except each node needs to hold multiple data types... My instructor told me to use structures, but I am still lost as to how to put all this data into the tree. [CODE]struct record{ long int student_id; char lastname[12]; char firstname[12]; char …

Member Avatar for Rockdrummer357
0
103
Member Avatar for Stefano Mtangoo

I have genuine VS 6 Keys as well as accompanying MSDN library. But VS set up CD is missing :( Where can I download VS 6 setup? I have wondered in MS site and all I see is no VS6, juststories about it!

Member Avatar for Stefano Mtangoo
0
134
Member Avatar for Instinctlol

Can someone explain to me why this shows up as Foothill (user input) : -9.222255e+061 ---------------------------------------------------- DeAnza (user input) : -9.222255e+061 ---------------------------------------------------- SJSU (user input) : -9.222255e+061 ---------------------------------------------------- : 10 ---------------------------------------------------- : 20 //my input ---------------------------------------------------- : 30 ---------------------------------------------------- [CODE]void VectorList::DailyReport() { cout << "==========NGS Daily Temperature Report==========" << endl; …

Member Avatar for stephen.id
0
85
Member Avatar for PDB1982

I'm now stuck on trying to figure out why my letterGrade function isn't working....I'm trying to take the numerical values found right before it, in the Avg colum, and turn it into a letter grad (which I assume needs to be as a string). Any suggestions? [code] Total Number of …

Member Avatar for Zjarek
0
217
Member Avatar for tkud

Hey everyone, can I create a folder using c++, just the way we create a file?

Member Avatar for tkud
0
97
Member Avatar for camipr64

new poster, need help with a pig latin translator. translation doesn't work properly, any tips or troubleshoots? sorry if it seems long... any help would be greatly appreciated [code] #include <iostream> #include <string> using namespace std; bool isVowel(char ch); string rotate(string pigStr); string pigLatinString(string pigStr); int main () { char …

Member Avatar for camipr64
0
117

The End.