49,761 Topics
| |
#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 … | |
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++){ … | |
**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..** | |
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 … | |
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 … | |
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 … | |
cout <<"a="; cin >> a; cout >> "b="; cin >> b; cout << c=a+b; goto a; error:undefined label 'a'. how to solve it? | |
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 … | |
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 … | |
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 … | |
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 | |
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 " << … | |
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 … | |
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 | |
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 … | |
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, … | |
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; } … | |
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 … | |
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 | |
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 … | |
#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 | |
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[], … | |
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: … | |
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 … | |
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)) | |
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 : "; … | |
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 … | |
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 … | |
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 | |
The End.