49,761 Topics

Member Avatar for
Member Avatar for brandon66

#include <iostream> #include <iomanip> #include <stack> #include <queue> #include <vector> #include <fstream> using namespace std; class graph { public: graph(); graph(int); //graph(int, int); void setEdge(int src, int dst); void printGraph();//print graph void bfs(int);//Breadth First Search void dfs(int);//Depth First Search void bfsSpan(int);//Breadth First Search Spanning Tree void dfsSpan(int);//DepthFirt Search Spanning Tree …

Member Avatar for brandon66
0
517
Member Avatar for Nyron

the last array array 3 is not giving me the desired output. i see no logic errors therefore i do not know why i am getting the wrong output. #include<stdio.h> int arr1[5]={55,145,950,25,500}; int arr2[5]={44,58,98,25,62}; int arr3[5],array1,array2,array3; int i=0,j=0,k=0; for(i=0;i<5;i++){ array1=arr1[i]*2; printf("array 1 doubled is %d . \n",array1); //i++; } for(j=0;j<5;j++){ …

Member Avatar for Nutster
0
236
Member Avatar for pretty_4

**i have to make a project program in C#.. i need some guidance about what to make and how.. i am little bit confuse about what to make .. So can please help me out Thank you..**

Member Avatar for pretty_4
0
200
Member Avatar for dstaner

Hey, i got some previous help with this program i had to write for a school assignment. The problem was assigned as follows: "Write a program that calculates the balance of a savings account at the end of a three-month period. It should ask the user for the starting balance …

Member Avatar for hichamhicham
0
2K
Member Avatar for can-mohan

Hi All, I just want to know whether use of shared_ptr is justified in below code here or do i need to use unique_ptr instead of shared_ptr? #include <iostream> #include <memory> using namespace std; class a { int a1 ,b; public: a(int x=0,int y=0):a1(x),b(y){} void fun1() {cout<<a1;cout<<b;} }; class b …

Member Avatar for madhav sai
0
198
Member Avatar for thehivetyrant

Hi there, i have a ball: [icode] void ball (void) { glColor3f(0.0, 1.0, 0.0); //set ball colour glTranslatef(0.0,0.0,1); //moving it toward the screen a bit on creation glutSolidSphere (0.6, 7, 7); //create ball. } [/icode] I am trying to get the ball to move in a direction when i press …

Member Avatar for Hasan_4
0
6K
Member Avatar for Sarath_2

cout <<"a="; cin >> a; cout >> "b="; cin >> b; cout << c=a+b; goto a; error:undefined label 'a'. how to solve it?

-1
101
Member Avatar for Tycellent

Hey everyone, In addition to... Lazy Foo's Tutorial http://lazyfoo.net/tutorials/SDL/index.php "SDL Game Development" - Shaun Mitchell book are there any other recommended resources (does not have to be SDL) people could suggest? I've already created a console-based text adventure game and am really interested in expanding it into a text-adventure game …

Member Avatar for wafa_1
0
292
Member Avatar for cambalinho

i have these code for get image pixel data: typedef std::vector<BYTE> pixeldata; pixeldata GetImagePixel(HDC hdcImage) { BITMAP bmp = {0}; BITMAPINFO Info = {0}; memset( &bmp, 0, sizeof(BITMAP) ); HBITMAP hBitmap =(HBITMAP) GetCurrentObject(hdcImage, OBJ_BITMAP); GetObject(hBitmap, sizeof(BITMAP), &bmp); BITMAPINFO info { }; info.bmiHeader.biSize = sizeof(info.bmiHeader); info.bmiHeader.biWidth = bmp.bmWidth; // pay attention …

Member Avatar for cambalinho
0
332
Member Avatar for cambalinho

i'm getting problems, again, on how i get the frame delay on gif files using Image class: UINT TotalBuffer = img2.GetPropertyItemSize(PropertyTagFrameDelay); //img2 = (PropertyItem*)malloc(TotalBuffer);//my compiler gives an error img2.GetPropertyItem(PropertyTagFrameDelay,TotalBuffer,&img2); framedelay=TotalBuffer; seems that the GDIPLUS can be a litte diferent from compiler to compiler :( so how can i get the …

0
107
Member Avatar for Joseph_19

write a c++ program that can use a linked list to store10 studets records with following fieds,reg no marks and grade.program shoould be able to enter records one after the other and display results

Member Avatar for rproffitt
-1
51
Member Avatar for Sasquadge

Hey guys working on an assignment called monkey business and here is my code im getting an error on these two things. Error: [CODE] cout << "Monkey number " << [COLOR="Green"](monkey + 1)[/COLOR] << " ate the least amount of food,\n" << leastFood << " pounds, on day " << …

Member Avatar for Muhammad_107
0
2K
Member Avatar for Christian Felix

where and how do I add array statement and ofstream? #include <iostream> using namespace std; int main(int argc, char** argv) { int size, crust, flavor, extra, order=0, total=0; cout<<"Good day! Welcome to Don Rogelio's Pizza. \n"; do{ cout<<"\nPizza size: (1)Small (2)Medium (3)Large :"; cin>>size; cout<<"\nPizza Crust: (1)Thin Crust (2)Regular Crust …

Member Avatar for tinstaafl
0
171
Member Avatar for JosesMelo

Hello, Is there any limitation for the length of array variables in C++? Can I specify the length as wanted or is there any limitation for the array length? What should be the array length, if the length is not known. wchar_t commandString[10000]; Cheers

Member Avatar for rubberman
0
290
Member Avatar for taylor0934

Hi, I needed some assistance on this program I am working on. First its about putting airplanes into gates, if no gates are open the print airport full. Right now mine simulates all the arrivals and departures. I show it put it will change when I implement the Stack. The …

Member Avatar for David W
0
1K
Member Avatar for Eskindir_1

I'm trying to to find elements into an array and look for the same elements into another array and i'm trying to assign the same ones with a 'y' for yes and 'n' for no, here is the code i did, but the code only reads it index by index, …

Member Avatar for Nutster
0
271
Member Avatar for Shoaib_6

In below program both **if statements gives an error** #include<iostream> #include<conio.h> using namespace std; class operation { int bank_id,balance; public: int input() { cout<<"enter the bank_id "; cin>>bank_id; cout<<"enter the balance "; cin>>balance; } operation operator ==(operation p) { operation b1,b2; b1.bank_id=bank_id+p.bank_id; b1.balance=balance+p.balance; b2.bank_id=bank_id+p.bank_id; b2.balance=balance+p.balance; if(b1==b2) { return b1; } …

Member Avatar for Nutster
0
264
Member Avatar for mariamalfarsi

Write program that reads an integer array until -1 is entered. It asks the user to enter starting and ending subscript of the array (index number). The main will call a recursive function that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the …

Member Avatar for rubberman
0
141
Member Avatar for JosesMelo

Hello, I have 2 **wstring** variables: std:wstring first =L"Jose"; std:wstring second = L"James"; How can I combine these variables: first + second gives an error in Visual Studio. Cheers

Member Avatar for rubberman
0
4K
Member Avatar for leonesa

log in password: Welcome! (1) Add (2) View (3) Search (4) Exit Choice: Add Employee Record Input no. of Employee: the system is now ready to accept_ employee records press any key to continue...... Add Employee Record Employee Name: Year of Service: Numeric Rate: Adding_Employee Record Successfully Done! Back to …

Member Avatar for Reverend Jim
0
248
Member Avatar for lakshay

#include<iostream.h> #include<stdlib.h> #include<conio.h> void main() { clrscr(); //char serial[]="EXAMS"; //int number[]={69,66,67,68}; randomize(); char planets[][10]={"Mercury","Venus","earth","Mars"}; //cout<<number[random(1)]; for(int i=0;i<4;i++) cout<<"::"<<planets[sizeof(char)+random(3)-1]; getch(); } How to calculate the output for it. Options: 1::venus::mercury::mars::earth 2::earth::mercury::venus::earth:: 3::mercury::earth::mercury::earth 4::mars::mercury::venus::earth

Member Avatar for rubberman
0
214
Member Avatar for shift25

Please help me figure out what is wrong with my code... [code] #include <iostream> // required to perform C++ stream I/O #include <iomanip> // required for parameterized stream manipulators using namespace std; // for accessing C++ Standard Library members //declaration of calculateAverage function-template prototype template <class T> T calculateAverage(T dataValue[], …

Member Avatar for Helly_1
0
1K
Member Avatar for sungilcool

I'm trying to build my skills here. This code compiles and runs successfully if I go out of class. It crashes when I need to enter numbers for matrices. Can somebody explain to me why this crashes? #pragma once #ifndef matrixType_h #define matrixType_h template <class T> class matrixType { public: …

Member Avatar for tinstaafl
0
1K
Member Avatar for Mike_29

I'm developing a game that has a word falling to the bottom of the screen and the user typing that word before it hits the bottom. So you'll be able to type input while the word is falling. Right now I have a timer that waits 5 seconds, prints the …

0
257
Member Avatar for mabdullah4

Can anyone tell me about these lines that why we use them in our program during filehandling process..Thanks in advance.. :) int pos=(-1)*static_cast<int>(sizeof(account))

Member Avatar for hericles
0
109
Member Avatar for mabdullah4

I can't Delete a specific record from my program.I need Your Help Guys.Thank's in Advance.. #include<iostream> #include<fstream> using namespace std; class teacher{ long long cnicno; char name[30],fathername[30],address[50],grade[10]; public: void input() { system("cls"); cout<<"Enter CNIC.No without '-' : "; cin>>cnicno; cout<<"Enter Name : "; cin.ignore(); cin.getline(name,30); cout<<"Enter Father Name : "; …

Member Avatar for tinstaafl
0
279
Member Avatar for toxicandy

Hello, I know that you don't provide solutions to homework but I know Daniweb will help with homework as long as we show we are doing some work ourselfs. My assignment is to generate the maximum spanning tree for a given matrix. I am CLOSE but not quite there. I …

Member Avatar for rubberman
0
2K
Member Avatar for CJMW

Okay... So I am an avid programmer. I have been writing applications in C, C++ and C# for almost 10 years now. I'm also a second year computer science student. Like many people I love computer games, more specifically adventure/ rpg games like runescape, elder scrolls etc. I have programmed …

Member Avatar for JOSheaIV
0
284
Member Avatar for karimabaza

Community Hospital needs a program to compute and print a statement for each patient. Charges for each day are as follows: a) Room charges: private room, $125.00; semiprivate room, $95.00; ward,$75.00 b)Telephone charge: $1.75 c)Television charge: $3.50

Member Avatar for rproffitt
0
77
Member Avatar for Oyeh

Please I need someone to help me write a function for x^3-w^k/q

Member Avatar for rubberman
-1
125

The End.