49,757 Topics
| |
here is the question: "write a program , which has as content "time is a great teacher but unfortunately it kills all its pupils" and outputs th reverse string to the disk file out.txt. My problem is that im stuck with the part on how to display the sentence in … | |
#include <cstdlib> #include <ctime> #include <iostream> using namespace std; int findSmallestRemainingElement (int array[], int size, int index); void swap (int array[], int first_index, int second_index); void sort (int array[], int size) { for ( int i = 0; i < size; i++ ) { int index = findSmallestRemainingElement( array, size, … | |
please help me i need a dynamic array that get the information as a matris and give me the vertex degrees (sum every row).and send it to another matrix. #include "stdafx.h" #include<conio.h> #include<iostream> #include <stdlib.h> #include <string.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int k,sum; cout << … | |
Hey guys,how can i retain the output window when stdio is used as my header? | |
I want to devide the text in file data.txt into an array of char*( mean i use the pointer char** q) by the way line 1 for q[1], line 2 for q[2] and.... but i don't know why it not work can everyone help me ??? :( char **q; const … | |
is there an easier way to write this code?? without using enum, enum MenuState{MenuPlay,MenuHelp,MenuExit}; MenuState ms=MenuPlay; char ch=0;//or anything other than '\r' while (ch!='\r')//IIRC getch returns '\r' when user hits enter { switch (ms) { case MenuPlay: cout<<"--> PLAY\n HELP\n EXIT\n"; break; case MenuHelp: cout<<" PLAY\n--> HELP\n EXIT\n"; break; case … | |
Hello again good people, i have done some coding on lexical analyzer phase of compiler but it is giving me some error that i am unable to understand.. Fair Warning: Code is a little longer. Here is the code: # include <iostream> # include <fstream> # include <string.h> # include … | |
Saw [this](http://www.daniweb.com/software-development/cpp/code/216430/add-a-little-graphics-to-your-console) and decided to make a little spinoff with some physics of mine. Enjoy! | |
how to write the fibonacci series by accepting the value of terms of the series from the user? | |
Hi, I have the following problem: Text file "strlines.dat" contains series of the following information of straight lines: 1) coordinate of one line's point 2) angle slope It looks like (x,y) 45 deg: 2,6 60 4,7 45 2,1 30 After adding this information to associative container verify it and find … | |
Is there a way to sort a vector with a class that has an int variable? I want to have my vector sorted and printed in console. I want to be able to sort the vectors. Say i create a bunch of vectors here on user input `vector<PCB> Disks2[DiskDevices];` Basically … | |
Could someone please sum up all the information or give me a link to a website why C++ is used for system programming. Ok, am realy on deadline for finishing my last highschool paper and I know this sounds like a homework question but I look it up on web … | |
Hi, I need to link a library you can download from producer's site (http://www.dahuasecurity.com/download_3.html) to my c++ project. The library is named General_NetSDK_Eng_Windows64_IS_V3.40.2.R.130321.7z. I tried to: * Linker->Input : added to addidiontal dependencies lines: dhnetsdk.lib dhconfigsdk.lib * Linked->General : added to additional library directories a "D:\dahua\" directory which includes files … | |
Is there a way to mimic creating multiple queues like this but with priority queue? This is what i have but i want to now use a priority queue. queue<PCB> Disks[DiskDevices]; I tried this but it doesnt work. priority_queue<PCB> DisksTest[DiskDevices]; It wont compile? What am i doing wrong? | |
I'm trying to store the contents of a file containing names of herbs and spices (items) in a 2D array called PantryContents. Then I'm trying to add an item to that array. It seems like only one item is being stored at a time, but the output is correct but … | |
Here is my code. #include <iostream> #include <math.h> #include <winsock.h> #include <windows.h> #include<stdio.h> #include<stdlib.h> #include<string.h> using namespace std; int main() { SOCKET s; WSADATA wsadata; int error = WSAStartup(0x0202, &wsadata); //Did something happen? if (error) return false; //Did we get the right Winsock version? if (wsadata.wVersion != 0x0202) { WSACleanup(); … | |
I get an error when I try to compile my code. I can't figure it out. It says it's not declared but I think it is declared. // // // This menu-driven program is used to allow the user to choose // an application to be executed. // // // … | |
Hi i was following a tutorial but i stuck at something i don't understand it This is to find out how many times a number appeered inside an array sorry for my English #include <iostream> #include <conio.h> using namespace std; int main() { const int size = 5; int arr[size] … | |
Here is the question: Write a program that creates a queue of Strings and allows the input of an integer value n, followed by n names to be placed in the queue. Then the program should execute a loop that performs the following: 1 It displays the name in the … | |
#include<iostream.h> #include <stdlib.h> //FOR exit(1) struct Flight { char flightNo[5]; char date[12]; char time[6]; char gate[3]; }; Flight flight={"AB11","10-12-2008","20:30","RT"}; struct Seat { char name[40]; char booking_ID[3]; int seats; }; Seat choice[4][5]; void displaymenu(); void booking(); void seat(); void ticket(); void records(); void menu(); void exit(); //Variables int selection,i,j,password; int seats_num[20]={0}; … | |
Hello, Please help me to overcome the following confussion. Suppose I have created an array of pointers like, A** l_aAPtr = new A*[l_iTotal]; for(int i = 0; i<l_iTotal;i++) { l_aAPtr[i] = new A(); } Now I want to delete this array. Please advise which of the following way is correct … | |
I dont no how to fix. Can someone help me out plz. (Please see the picture) [IMG]http://i61.tinypic.com/2r2cfnq.png[/IMG] #ifndef DYNINTSTACK_H #define DYNINTSTACK_H class DynIntStack { private: // Structure for stack nodes struct StackNode { int value; // Value in the node StackNode *next; // Pointer to the next node }; StackNode … | |
ok i am very sorry if this comes off as irritating to some, but i need someone to reassure or direct me. i have learned some programming, very very basic to be exact and i have learned some c# and some C++. the problem is, I like c# because it … | |
IplImage *in; CvMemStorage *storage = cvCreateMemStorage (20506); CvSeq *contours=NULL; CvPoint *PointArray=NULL; for() { //image processing and feature extraction code here cvClearMemStorage (storage); //clear memory area free (PointArray); cvReleaseImage (&in); } At the end of each iteration i ma releasing memory but still i get memory shortage error after # processing … | |
Hello All Tell me who is correct I or my friend void main() { int GuessMe[4]={100, 50, 200, 20}; int Taker=random(2)+2; for(int Chance=0;Chance<Taker;Chance++) cout<<GuessMe[Chance]<<"#"; } I am testing random() in Turbo C++ 3.5 By this code I am always getting answer 100#50# whenever I am executing this code. My argument … | |
Does anyone know of a compiler that translates a C++ code to MIPS Assembly Language | |
Just like the title says, could you give me arguments for it? | |
I am to make a rev op on linked node but somehow i couldnt get to work. I got an error I am kinda stuck right now. The error is in gray Somehow and somewhere doesnt show the reverse link. Can someone show how to do the search node like? … | |
i have a problem and i can not solve it. Problem is that for example there is an admission form on internet and a student enter his name in digits no dought it is wrong and now here is a problem how to restrict the student that he/she should not … |
The End.