49,766 Topics

Member Avatar for
Member Avatar for mymyzzz

I need to finish this program, but i have no idea how to! please help me figure this out. [code] #include <iostream> #include <fstream> using namespace std; void printShips(char [15][15]); void fire(int row, int col, char ocean[15][15], char &result, char &ship); struct counter { int B, C, D, F, T, …

Member Avatar for Clinton Portis
0
403
Member Avatar for eduard77

Can anyone tell me what is wrong with this code? I found it on Wikipedia When I compile it it gives me a lot of errors [code] void parallel(int num_threads,int matrix_demention) int i; for(i=0;i<num_threads;i++) create_thread(&threads[i],i); pthread_attr_destroy(&attr); // Free attribute and wait for the other threads for(i=0;i<p;i++) pthread_join(threads[i],NULL); void *gauss(int thread_id) …

Member Avatar for Clinton Portis
0
141
Member Avatar for amel036yippee

Hello! I'm a newbie here... Straight to the point, I tried to create a program as stated in the title above musing C++. Below are the code I used: [CODE]#include <iostream> #include <cstdlib> const board=8; const pop=20; using std::cout; using std::endl; double table[board][board]; int r; int c; int main() { …

Member Avatar for amel036yippee
0
99
Member Avatar for Stefano Mtangoo

I see alot of libraries written in C and I like C++ OOP way. How can I use a given C library functions in C++?

Member Avatar for Stefano Mtangoo
0
175
Member Avatar for uberian22

i am getting errors when i compile this program [CODE]#include <iostream> #include <cctype> using namespace std; const int MAX_DIGITS = 20; int size; // number of digits in the integer int digit[MAX_DIGITS]; // the digits stored in reverse order void inputBigInt (int a[], int& sizeA); / void outputBigInt(int a[], int …

Member Avatar for uberian22
0
77
Member Avatar for 07tr0wa07

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 …

Member Avatar for Lerner
0
272
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
653
Member Avatar for richman0829

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 …

Member Avatar for Lerner
0
106
Member Avatar for DevC++4.9.9.2

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 …

Member Avatar for r.stiltskin
0
124
Member Avatar for BigTito89

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

Member Avatar for BigTito89
0
160
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
226
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
391
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
101
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
95
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
250
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
152
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
110
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
169
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
126
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
188
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
63
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
133
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
135
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
124
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
240
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
109

The End.