49,761 Topics

Member Avatar for
Member Avatar for juangalvez4

This week in class we are looking at functions and how to use them. This is the example we got during class: [CODE]#include <iostream> #include <string> using namespace std; //function prototype int getTotal(int,string); void verifySeasons (int&); int main() { string name; // name of player int totalGoals = 0; // …

Member Avatar for pseudorandom21
0
134
Member Avatar for Prasanna Venkat

Hi friends, I am a final year Mechanical Student and I am doing my Final year project in C++. My project requires some complicated programming in C++.. Here are the details. Initially I need to create a random matrix. The user will give the no of rows and columns. For …

Member Avatar for pseudorandom21
0
180
Member Avatar for fabricetoussain

[CODE] /* Fabrice Toussaint section N938 Feburary 1, 2011 Purspose of program is to locate centroid and find distance between all three points and centroid */ #include <iostream>// for cout and cin #include <cmath> // for sqrt () and pow (x,y) using namespace std; int main () { float distance1; …

Member Avatar for pseudorandom21
0
111
Member Avatar for L3gacy

I use Microsoft Visual Studio Professional on my Desktop PC, but my GTX 260 just failed and im dojng an RMA, so I started trying to program on my laptop. I am around 1/3 of the way through Ivor Hortons Beginning Visual C++, the book covers Native C++ and C++/CLI, …

Member Avatar for mike_2000_17
0
396
Member Avatar for chamnab

HI Everyone ! Do anyone know how to split string ? Especially this one . Do anyone know funtion "__DATE__" , it show month/date/year. you know ,it is string so i want to separate it because i need month to make condition.

Member Avatar for chrjs
0
105
Member Avatar for juangalvez4

First of all, hi everyone! Im a C++ newbie and i'd like to get a good grasp of the concepts soon. I'm currently working on this [CODE]#include <iostream> using namespace std; int main() { int i, j, lines; cout << "This Program creates Christmas Trees." << endl; do { cout …

Member Avatar for juangalvez4
0
132
Member Avatar for canadiancoder

Hi Folks, I've been looking around all day and I've tried numerous suggestions, but to no avail. I've got a struct in C# defined as: [code] [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct GenericTrackRecord<T> { public Int32 hasValue; public T value; } [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct OTXFixDetailsStruct { public …

Member Avatar for canadiancoder
0
2K
Member Avatar for Fumomo

Hi all, I was hoping for some help and hints to the problem i'm facing now. Right now i have a a 2D array which stores the elements: 22Jan11 180 11Feb11 111 22Jan11 90 22Jan11 30 25Jan11 110 I'm trying to basically add up the the value of the duplicate …

Member Avatar for drkybelk
0
122
Member Avatar for Zvjezdan23

[CODE]// This program is supposed to figure out how much does a custom banner cost by figuring out the price for each letter and outputting it's total to the screen. #include <iostream> #include <string> using namespace std; int main() { double cost, total; string banner; cout << "Enter Your Banner …

Member Avatar for KKR_WE_RULE
0
361
Member Avatar for vjrabanelly

Hi, I'm using C++ without MFC nor ATL, to create a popup, opening from a DLL loaded in Internet Explorer as Browser Helper Object (all versions from IE7, from XP to Windows 7). Until now, everything went find and my popup is working as I wish. But now I'd like …

Member Avatar for vjrabanelly
0
242
Member Avatar for L3gacy

Im doing a code "test" from the c++ book I am currently reading, the objective is to ask for input using a function and output data using a function, while keeping the data in main. I finished it and it works, but I want to make the program not accept …

Member Avatar for L3gacy
0
255
Member Avatar for icez17

Hi, I'm writing a small piece of code finding the number of unique 3D arrays in a N*3 array. I first sort the N*3 array, and apply a "condition" function : if the consecutive 3D arrays do not have the same element, then the unique number count +1. Here is …

Member Avatar for icez17
0
244
Member Avatar for stankefa

[CODE] class X { public: X () : myID(id) {} X (const X& right) : myID(++id) {} friend ostream& operator<< (ostream&, const X&); private: static int id; int myID; }; int X::id = 0; ostream& operator<< (ostream& os, const X& x) { return os<<x.myID; } X f (X x1, X& …

Member Avatar for Fbody
0
196
Member Avatar for sahil1991

hi to all, can anyone tell me about streambuf and filebuf classes...i got to know that ios contains a pointer to streambuf....so it must be something important ,right?.....

Member Avatar for L7Sqr
0
58
Member Avatar for mahban

I need to yourhelp,too. can you write this programm :sum and multy 2 sparsematrix with linklist?(language c++)

Member Avatar for peter_budo
0
67
Member Avatar for Kumar_cr09

Hi...I want to create a timer so that after completing the time(suppose 10 sec) the control should come out of the function..Please note that am starting the timer inside the function..is this possible in c++...

Member Avatar for Ancient Dragon
0
145
Member Avatar for deanus

Hi, If I'm not mistaken, the following code will allocate 5 integer elements from memory to 'ptr': [CODE] int *ptr; ptr = new int[5]; [/CODE] If after this code I enter the following: [CODE] ptr = new int[7]; [/CODE] will the original 5 elements be overwritten or deallocated? Or will …

Member Avatar for ravenous
0
133
Member Avatar for cml352

Here is my code: slist.hpp [CODE]#ifndef SLIST_HPP #define SLIST_HPP #include"slist.h" #include"slistiterator.h" #include"slistiterator.hpp" template<typename generic> SList<generic>::SList() { m_size = 0; m_front = NULL; } template<typename generic> SList<generic>::SList(const SList<generic>& s) : m_front(NULL), m_size(0) { *this = s; } template<typename generic> SList<generic>::~SList() { clear(); } template<typename generic> void SList<generic>::push_front(generic x) { SNode<generic>* temp …

Member Avatar for cml352
0
204
Member Avatar for paramveer

HEllo Everybody..... feels nice to be part of daniweb..community..joined only today...... i am quite ignorant of XML.....but now i have to develop a c/c++ program which reads a XML file......stored on LAN.....retreives the content of the file...and do necesarry manipulation with the retreived data......actually the xml file contains the name …

Member Avatar for giskumar
0
3K
Member Avatar for jonayn

how to create a function that will count and display all even numbers . the function will populate 30 integers with random 2-digit number and return count of even numbers ?

Member Avatar for Nandomo
0
66
Member Avatar for sosongetsu

I have been working on this program for about a week and i have been getting these errors that i just cant get by. The program is supposed to first accept user input for the type of symbol. Then its supposed to accept user input for a number. Finally it …

Member Avatar for sosongetsu
0
192
Member Avatar for HeartBalloon

Hi, I have this simple code: [CODE] const int kiCharSize=30; const int kiDate=7; struct Customer{ char caName[kiCharSize]; char caSurname[kiCharSize]; char caCity[kiCharSize]; char caPhone[kiCharSize]; char caDate[kiDate]; char cDay; enum eDay{M,A}; char caBrand[kiCharSize]; }; blablabla Customers::Customers(int x){ switch(x){ case 1: Cust.caBrand="HolyBrand"; Cust.caCity="Heaven"; Cust.caDate="110205"; Cust.caName="Jeesus"; Cust.caPhone="999333999"; Cust.caSurname="HolySpirit"; Cust.cDay='M'; break; case 2: Cust.caBrand="Brandutsu"; Cust.caCity="Japan"; …

Member Avatar for Nandomo
0
145
Member Avatar for Xytheron

Hey all! Long time reader, first time poster! So I'm trying to communicated between two processes on a UNIX machine using shared memory. I believe everything in this program is working fine except for how I'm attempting to call the memory to check. Basically the parent process writes to the …

Member Avatar for Xytheron
0
164
Member Avatar for JordanHam

[CODE] int main() { double t[]={15.70, 29.39, 41.14, 56.47, 75.61, 98.83 ,112.42, 125.61, 129.39, 133.45,138.94, 141.41, 143.67, 144.63, 144.95, 145.16, 146.25, 146.70, 147.26 , 148.15, 152.40}; int n = sizeof (t)/sizeof (t[0]); FindLN(t, n); return 0; } void FindLN(double t[], int n) { int index; double lnt[n]; for (index=0; index<n; …

Member Avatar for Nandomo
0
174
Member Avatar for Nandomo

I really don't know how to capture the information from the bitmap file when talking about the pixelArray, I know what I have to do it when I capture it to turn it negative, but each time I run my code it crashes when I run the code I think …

Member Avatar for Nandomo
0
169
Member Avatar for eline83

Hello guys. I'm stuck at my algorithm assignment. Here is the problem. We found that the solution to the mergesort recurrence f(n) = f(┏n/2┓) + f(└n/2┘) + n, f(1) = 0 satisfied f(n) = Θ(nlogn). Find an expression for the exact value of f(n). (Hint: generate the first 20 to …

Member Avatar for mike_2000_17
0
108
Member Avatar for becool007

Hey Im tryin to make a simple project which is pretty simple, but I cant seem to get it right :P Anyways, it goes like this. I have the main file which creates the window and stuff. And then I have an other file which populates the main file with …

Member Avatar for becool007
0
366
Member Avatar for wondernaet

I was told that I could compact this code in 2 ways. I can't use loops. Can anyone see it? #include <iostream> #include <string> using namespace std; void daysOfChristmas (int days, char switcher, string b[12]){ (days > 0 && switcher == 'y') ? daysOfChristmas(days - 1, 'y', b): false; (days …

Member Avatar for sfuo
0
89
Member Avatar for becool007

Okay so I wont to output text onto my win32 program. I read somewhere that TextOut() is the function i need but it is not as good as DrawText(); Ive been trying to use DrawText() but i get stuck at the 4 parameter asking for a RECT. Any help ? …

Member Avatar for caut_baia
0
152
Member Avatar for HeartBalloon

I don't know what it means: [CODE] class Tree{ friend ostream& operator<<(ostream&, const Tree&); private: TreeNode *Root; void insert(TreeNode*&,int); void PrintInOrder(TreeNode*); int Median(int[],int&); public: Tree(); Tree(int); void insa(int[]); void ins(int); void print(); }; ostream& operator<<(ostream& out, const Tree& tree){ out << tree.Root ->GiveValue(tree.Root); return out; } Tree::Tree (){ Root = …

Member Avatar for HeartBalloon
0
987

The End.