49,757 Topics

Member Avatar for
Member Avatar for nitish.mohiputlall

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 …

Member Avatar for VertexF3
0
147
Member Avatar for Praveen_10

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

Member Avatar for vmanes
0
316
Member Avatar for arashe

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

Member Avatar for Schol-R-LEA
0
369
Member Avatar for iblanq
Member Avatar for hades2610

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 …

Member Avatar for Ancient Dragon
0
351
Member Avatar for Vikram Sehgal

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 …

Member Avatar for L7Sqr
0
266
Member Avatar for sana.f.qureshi_1

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 …

Member Avatar for VertexF3
0
1K
Member Avatar for William Hemsworth

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!

Member Avatar for YassinTAH
1
446
Member Avatar for Dagmawit

how to write the fibonacci series by accepting the value of terms of the series from the user?

Member Avatar for danyal baig
0
153
Member Avatar for Auroch

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 …

Member Avatar for Auroch
0
208
Member Avatar for mystycs

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 …

Member Avatar for Schol-R-LEA
0
414
Member Avatar for nhiap6

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 …

Member Avatar for NathanOliver
0
186
Member Avatar for bejfake

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 …

Member Avatar for bejfake
0
533
Member Avatar for mystycs

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?

Member Avatar for mystycs
0
488
Member Avatar for Emma_3

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 …

Member Avatar for Emma_3
0
261
Member Avatar for learner_new

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(); …

Member Avatar for BobS0327
0
336
Member Avatar for phony

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. // // // …

Member Avatar for phony
0
752
Member Avatar for Sarkurd

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

Member Avatar for Sarkurd
0
307
Member Avatar for nitish.mohiputlall

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 …

Member Avatar for Moschops
0
137
Member Avatar for software girl

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

Member Avatar for Ancient Dragon
-1
282
Member Avatar for evaxhoxha
Member Avatar for amt_muk

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 …

Member Avatar for amt_muk
0
235
Member Avatar for chubbyy.putto

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 …

Member Avatar for Schol-R-LEA
0
155
Member Avatar for mxood

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 …

Member Avatar for rubberman
0
244
Member Avatar for ravi_14

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 …

Member Avatar for rubberman
0
333
Member Avatar for vishalonne

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 …

Member Avatar for vishalonne
0
270
Member Avatar for jamesc205

Does anyone know of a compiler that translates a C++ code to MIPS Assembly Language

Member Avatar for mike_2000_17
0
451
Member Avatar for nhiap6
Member Avatar for chubbyy.putto

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

Member Avatar for chubbyy.putto
0
202
Member Avatar for moaz.amin.37

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 …

Member Avatar for Ancient Dragon
0
126

The End.