16 Solved Topics

Remove Filter
Member Avatar for Nikhar

I am writing a c++ code (or any sort of code for that matter) after one complete year. And yet I don't think I could have become so bad that I can't make a Hello World program. Still, here I am with so many errors. Here's the code:- [CODE]#include <iostream> …

Member Avatar for pc75
0
3K
Member Avatar for Nikhar

I am a newbie, in crafty as well as js, so pardon me if I might have made very silly errors in the following program. What is wrong with the following code? The following code is supposed to create 5*5 matrix where each block would be a 60 pixel high …

Member Avatar for Nikhar
0
222
Member Avatar for Nikhar

The following is my code for Edit Distance problem. The problem asks us to find the edit distance between two strings. My code, I think gives the correct output. If I run the code with two strings of 1500 length each, I get the error. But if I run it …

Member Avatar for Nikhar
0
351
Member Avatar for Nikhar

Hey...guys while downloading one of the files I got a whopping 100 seeds.... and a sucking 20kbps download speed! I am very new to the world of torrents...in fact only began yesterday. So, I do not have much idea about torrents. I have a few questions. Firstly, the rate at …

Member Avatar for orwell84
0
235
Member Avatar for Nikhar

I have been studying graphs currently and came across a way to implement it. [code] #include<iostream> #include<vector> #include<string> #include<map> #include<functional> #include<cstdlib> using namespace std; struct vertex; struct edge { vertex *dest; double cost; edge(vertex *a=NULL, double b=0) { dest=a; cost=b; } }; struct vertex { string name; vector<edge> adj; vertex(string …

Member Avatar for Nikhar
-1
110
Member Avatar for Nikhar

I have made a program to the follwoing problem:- [QUOTE] Another chessboard puzzle (this one reputedly solved by GAUSS at the age of four) is to find a sequence of moves by a knight that will visit every square of the board exactly once. Write a backtracking program that will …

Member Avatar for Nikhar
0
174
Member Avatar for Nikhar

Hi guys...I am learning binary trees and its quite interesting. But I am unable to make4 a the delete a node function in it. Whenever I try to delete a node, a fatal error occurs and the program closes. Can you please point the error out for me in the …

Member Avatar for Nikhar
0
126
Member Avatar for Nikhar
Member Avatar for Nikhar
0
65
Member Avatar for Nikhar

Hey guys...I have delayed asking this for too long but maybe its high time. My UPS faced some problems and it would automatically close down. So, basically windows was shut down improperly. Now, the problem is that my computer wont run chkdsk and thereare lots of damaged files. I tried …

Member Avatar for Nikhar
0
131
Member Avatar for Nikhar

Hey guys...Can you please help me explain what does returning an istream object mean. I am currently studying Accelerated C++ and at many places a function returns istream object. What does it mean? For example:- [CODE]istream& read(istream& is, Student_info& s) { // read and store the student's name and midterm …

Member Avatar for Nikhar
0
2K
Member Avatar for Nikhar

[code] #include<iostream.h> #include<conio.h> class suitcase { int sno[20]; long double amount[20]; public: suitcase(); void print() { int i; for(i=0;i<=19;i++) cout<<amount[i]<<'\n'; } }; suitcase::suitcase() { amount[20]={0.25,1.0,10.0,100.0,250.0,500.0,1000.0,5000.0,10000.0,50000.0, 100000.0,200000.0,300000.0,400000.0,500000.0,1000000.0, 2500000.0,5000000.0,7500000.0,10000000.0}; } void main() { suitcase s1; s1.print(); } [/code] When I run this program, I get an error :- [quote]expression syntax in function …

Member Avatar for Nikhar
0
104
Member Avatar for Nikhar

I'll try to get this as simple as possible. The problem is fairly simple. [code] long double a=100000000; cout<<a; [/code] Well, the output this shows is "1e+08" I do not want the output to be in exponential form. Rather, I want it to be printed as "100000000". What shall I …

Member Avatar for s_sridhar
0
109
Member Avatar for Nikhar

Well, I posted a few problems here on daniweb and thank god that I did so. What I had been using till now was "rusted, naff,useless" code. But after today, I am more accustomed to what the new c++ is. Well, I am 16 years old and am studying in …

Member Avatar for siddhant3s
0
336
Member Avatar for Nikhar

Hi everyone. Can anyone please guide me on how can I generate a random number from a group of prset numbers. For example:- There is a group of preset numbers:- 1,5,18,100,127,500,626,929. I want to generate a random number from this group....is there anyway in which we could do this?

Member Avatar for Nikhar
0
359
Member Avatar for Nikhar

Hi....whenever I try top open a .exe file....this is the error that I get:- The file does not have a program associated with it for performing this action. Create an association in the folder options in control menu. I tried to add a new extension as exe in file types …

Member Avatar for jbennet
0
173
Member Avatar for Nikhar

Hi...this is the code that I wrote to find a particular string from a 2-d array of characters. It prints F(for found) and N(for Not found). When I execute this program, it prints N only. [code]#include<iostream.h> #include<conio.h> char SearchString(char[5][10],char[10]); void main() { clrscr(); char str1[5][10],str2[10]; int i; cout<<"\nEnter 5 objects:-"; …

Member Avatar for Nikhar
0
136

The End.