49,761 Topics
| |
Hi guys i'm new in C++..:icon_wink: I have a homework that i need to pass soon and i need help because i only have 1 error and i'm staring at it for 2 hours:icon_cry: going back and forth to my book and came up with no solution:icon_sad:. ok so heres … | |
Some C++ buzzwords a programmer need to grasp really boggles my mind. I try to understand them but I strangely, get dim understanding of them (am I tired? Need a vacation?). Anyway please help me understand the following big words in C++ 1. Virtual Functions 2. Polymorphism Thanks alot | |
I think the pieces, taken separately, are okay, but they don't seem to play together well. [CODE] //lab12: This program requests input of ten employee names and salaries; //a file is created and they are written into it, and the file is closed. //The file is then reopened and the … | |
hey im trying to do a quick mod function, i know % exists but this will have other applications... Basically the main issues is when you return "num" it is a different value than if you look at num before it is returned... Any ideas? thanks in advance [code] int … | |
Hello, for my final team project for C++ we are making a simple space invaders clone with the [URL="http://www.libsdl.org/"]SDL[/URL] libraries. Most of it is working great so far but in order to 'destroy' the enemies, they must not be drawn anymore and should be destructed. ER is just the # … | |
[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 … | |
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> … | |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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) … | |
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 … | |
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:-/ | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
hi, I need help in adding questions in a program using strings, structures or array............. Plz help me n snd the code | |
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 … |
The End.