581 Posted Topics

Member Avatar for rmlopes

It is really hard for us to actually find the error without knowing what exactly your code is , Though You dont post the whole code, Post the Class And atleast 20 Lines Before and After the Class Definition, Other-wise you can attach the whole file (donot forget to include …

Member Avatar for rmlopes
0
157
Member Avatar for csurfer

Well , I believe that , Random Numbers arent really random at all, Even if you ask a human to tell a sequence of random numbers they are again dependant on the mentality of a human being i mean his likes or dislikes , Date of Importance to him, What …

Member Avatar for GrimJack
0
332
Member Avatar for julia2009
Member Avatar for ArcRoyal
0
1K
Member Avatar for lexusdominus

This is what organising is all about. First to get rid of the string error, Include string in the header file. Next, You can either put all your class declarations on the top of your header file or you can declare prototypes of the class in the top of the …

Member Avatar for lexusdominus
0
158
Member Avatar for gwen73

Hello Gwen, Welcome to DANIWEB. Well though I see that your declaration of a struct is quite proper, There is a major fault in your code. First of , we start by considering what exactly a [icode]struct[/icode] is. When you use the struct specifier , its almost like you are …

Member Avatar for s_sridhar
0
166
Member Avatar for vishalonne

Welcome to Daniweb and Also to C++, Firstly Please Use CODE TAGS the next time you post in your question, Firstly I see that you are Using a outdated compiler. Though it is not il-legal to use it . It is considered better if you use a modern compiler like …

Member Avatar for monkey_king
0
208
Member Avatar for goody11

[code] BOOL WINAPI ExitWindowsEx(UINT EWX_REBOOT, DWORD SHTDN_REASON_MAJOR_HARDWARE); [/code] This somehow looks like you are declaring a function . Though what you need is to call it. I am not a Windows expert but try this. [code] ExitWindowsEx(UINT EWX_REBOOT, DWORD SHTDN_REASON_MAJOR_HARDWARE); [/code] Also check if the function is embedded into a …

Member Avatar for goody11
0
187
Member Avatar for catchmrbharath

Firsty, The Code for The Sieve is faulty.Actually its not a sieve at all. But anyways, Lets come back to the Segmentation fault, The reason for the segmentation fault is that your code [icode]j=i*i;[/icode] is actually causing j to cross the bounds of an integer at a high value of …

Member Avatar for siddhant3s
0
293
Member Avatar for Sky Diploma

I am confused by the use of an un-named namespace and its practical applications. The C++ Programming Language states that. [code] namespace { //Content } [/code] [b][COLOR="Green"]is equal to [/COLOR][/b] [code] namespace $$$ { //Content } using namespace $$$; [/code] Where $$$ is a unknown and random name. However I …

Member Avatar for siddhant3s
0
110
Member Avatar for matt4615

Hey, Arent you using the wrong formula, I mean the geometric sequence. [TEX] a/i-r[/TEX] is the value when a geometric progression goes to infinity. But we know that i ranges from 1 to 38. so we have a progression of 'n' terms, which is calculated by a((r^(n+1)-1)/r-1)) [url]http://en.wikipedia.org/wiki/Geometric_progression#Geometric_series[/url]

Member Avatar for VernonDozier
0
845
Member Avatar for mirfan00

Search for the problem on the net before posting. [url]http://www.dreamincode.net/forums/showtopic81897.htm[/url] This is a good way of doing it,

Member Avatar for Narue
0
198
Member Avatar for llemes4011

not only dummyarray but also the int array [icode] hit[/icode] Should also have a specific size.

Member Avatar for Narue
0
101
Member Avatar for mathueie

This mostly appears when you have not specified main to return a certain type, Though that is just in general , It would be better if you would post your code down. [code] main(){//Causes the error [/code] [code] int main(){//No Error, [/code] Though that is pretty generalised, Hope its the …

Member Avatar for mathueie
0
2K
Member Avatar for JackDurden

[code=c++] node *Find_Empty_Node(node* root) { int index = 0; if(root) { if(root->data == 0)//<--I want this child return tree->child[index]; for(int i = 0;i<root->child.size();i++) { index = i; return Find_Empty_Node(root->child[i]); } } return tree; } [/code] Shouldnt this be the way to do it? I mean return the Empty Node as …

Member Avatar for rcollins
0
110
Member Avatar for KuriYokan

Well to start of with [CODE=C++]void getName(char* dump){ strcpy(dump,name); } [/CODE] Only copys the variable name which is your private variable into dump. That way the user would only recieve a copy of your private member and not get access to it . [code=c++] void getName(char* dump) const{ strcpy(dump,name); } …

Member Avatar for Sky Diploma
0
156
Member Avatar for Salem

>>I was asked some interesting validation questions like: >>Creamy or Crunchy? I answered crunchy (you have to be pretty deep American to even understand the question). What does that mean by-the-way ? :)

Member Avatar for GrimJack
1
196
Member Avatar for vivek3227

I dont think there is a determinant for a non-square matrix. [url]http://en.wikipedia.org/wiki/Determinant[/url] You can look at Lebnitz formula. Its easy to write.

Member Avatar for siddhant3s
0
124
Member Avatar for timb89

Timb i guess you should [code] return isPalindrome(s.substr(1,s.length()-2)); [/code]

Member Avatar for Stinomus
0
1K
Member Avatar for JaksLax

[code] int Poly::coefficient(int power){ for(int i = 0; i < 10; i++){ i++; //increment i to skip over coefficient if(poly[i] == power){ return poly[i - 1]; } } [/code] What does the function return if your value is not found? And secondly Though I understand the code. I am pretty …

Member Avatar for Stinomus
0
117
Member Avatar for JackDurden

Childen is of type vector. I think that you should use [icode]push_back(value);[/icode] to handle that.

Member Avatar for VernonDozier
0
107
Member Avatar for vishalag

Welcome to the forum Vishal, Your question is very faint for us, without knowing your actual implementation. Please post example codes so we can have an idea about what exactly your problem is.

Member Avatar for Sky Diploma
0
114
Member Avatar for ithelp

Lol , My Enter/Return key is currently broken. So i got used to pressing the Enter key at the Number Panel.

Member Avatar for vegaseat
0
164
Member Avatar for Usura

Lol. Firstly there is an issue. You donot know the size of the char* and therefore i dont think that you might consider creating a char without a particular size defined. And by the way if you know the size of the array of the char* wouldn't it be a …

Member Avatar for Ancient Dragon
0
69
Member Avatar for kabeer62

Lol use the automatic programme completer. That is available here: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] The above post was in regard to the title of your thread. Now, I would like you to rephrase your question and ask us for help if necessary. Apart from that you will need to tell where exactly are …

Member Avatar for KuriYokan
0
120
Member Avatar for timb89
Member Avatar for andonyan

Shouldnt pointer be destructed using a [icode]delete [];[/icode] and not [icode] delete;[/icode]?

Member Avatar for Sky Diploma
0
323
Member Avatar for mimio134

This is almost like a Implementation that I have made a few days ago. Though My Objective was not on Addition and Subtraction But Multiplication of Large Positive Integers. mimio, For doing this , I think the main objective here is to teach addition or subtraction to the computer. Just …

Member Avatar for Sky Diploma
0
2K
Member Avatar for Prasannanjaneyu

C++ has a wide variety of Container Classes. Each Container Class has its suitability for diffirent operations. For Example : a [icode]vector[/icode] found in [icode]#include <vector>[/icode] Is a container. Apart from that there are many of these containers such as Stack or Queue etc. >>"Please let me know how can …

Member Avatar for Sky Diploma
0
179
Member Avatar for fadia

Firstly from the question arent you supposed to read from "data.txt" and not "read_data.txt" Secondly. I am quiet confused with your code. You should first post all the Numbers into the file and then read in from the file again to perform math calculations ?

Member Avatar for ArkM
0
137
Member Avatar for catchmrbharath

Google is your friend. [url]http://www.mathlinks.ro/viewtopic.php?t=277509[/url] [url]http://en.wikipedia.org/wiki/Divisor_function[/url] I guess you can use that there. :) I guess you guys need it for the coding competition. [url]http://www.codechef.com/JUNE09/problems/D1/[/url]

Member Avatar for ArkM
0
138
Member Avatar for catchmrbharath

I guess the solution can be calculated in the following way as well. [code] int x=0; int number=10000; while(number!=0) { number=number/5; x+=number; } [/code]

Member Avatar for Sky Diploma
0
145
Member Avatar for nhamyl

Donot post C - Code in the C++ Forum. Secondly. Please show what you have come up with .... I mean post the code that you have tried. with looping mechanisms.. EDIT: ALSO USE CODE-TAGS [ CODE ] [/ CODE ]

Member Avatar for siddhant3s
0
88
Member Avatar for Barbarrosa

[code] #include <iostream> using namespace std; int main() { int num = 9; cin>>num; char x=num; cout<<x<<endl; } [/code] Try that code out entering a certain number each time. Conversion is implicit , I think if a number is inputted and number >255, Then char x=(char)number%255; Is what takes place. …

Member Avatar for Sky Diploma
0
176
Member Avatar for Sky Diploma

Hey All, I have purchased a new PSU for my computer which is running on an Intel D845GVSR with Intel Pentium-4 Processor. The Problem is that , When I power up my computer The Fans(Ventilation Fans ) spin once and stop. When i contacted my vendor regarding this. It seems …

Member Avatar for Jupiter 2
0
175
Member Avatar for BlackStar

[CODE] char action; cout<<"how many?"; cin>>action; if(sub_choice(action)) { while (action == 'C') { Customer *CUST = new Customer; int count = 1; CUST->lineNumber = count; count++; CUST = CUST-> next; } } [/CODE] You get a Infinite Loop because the value of action doesnt change once you give the input …

Member Avatar for BlackStar
0
417
Member Avatar for Sune

However in this Both the terms almost mean the same thing. Just see that The do while loop first executes the whole block and then gets to the condition!

Member Avatar for e.shankar87
0
226
Member Avatar for FaNtEcH

Learn to DEBUG!!! There are many debuggers out there learn to use them and run your programmer in debugger mode.

Member Avatar for tux4life
0
2K
Member Avatar for dev565

I guess the best way to know is to test it! Put a try block to catch all and enter an invalid file. See what happens?

Member Avatar for Liszt
0
112
Member Avatar for Sky Diploma

[code=c++] void func(char*,int&);//A function returning no value and taking a char and reference to int as arguments. typedef void (*PTR)(char*,int&);//A pointer to function returning no value and taking a char and reference to int as arguments. void Func2(PTR);//A Function taking such a pointer as argument. PTR Func3();//A Function returning such …

Member Avatar for Dave Sinkula
0
144
Member Avatar for newcpp

Firstly what do you mean by initialisation mechanism. If you are trying to pre initialise your vector. The best way to do it is through a constructor. Check this site out [url]http://www.cplusplus.com/reference/stl/vector/vector/[/url]

Member Avatar for newcpp
0
7K
Member Avatar for spectrum6125

Well when the page loads up. You SHOULD CHECK OUT THE source and see for the names of the forms. then you can write something like this "http://www.some.some/login.php?FORMNAME1=Username&FORMNAME2=Password Replace formname with the actual form names in the source and User Name and password with your user names :)

Member Avatar for Sky Diploma
0
115
Member Avatar for effective
Member Avatar for ithelp
0
107
Member Avatar for xiaojesus

>>can someone enlighten me? Lol, I donot know about enlightening, but do know where the error is. You have defined a function [code] Account operator +(const Account &rhs,double i) [/code] What Salem means to say is. In the declaration of Class Account. You have not added the "PROTOTYPE" or declaration …

Member Avatar for Sky Diploma
0
89
Member Avatar for awais.abdul
Member Avatar for 3beer
Member Avatar for handytxg

Apart from that . The using of new operators and not deleting them is causing a memory leak everytime you run your code.

Member Avatar for tux4life
0
257
Member Avatar for Xellos_Moon

>>Help me solve this problem, dont worry, im just starting out so its all very basic...and easy to you guys, i would imagine. I'm already worried , But anyways here is my solution [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for ArkM
0
91
Member Avatar for Akis2000

[code] for (long int j=1,n=1; n,j <= i; j++,n++) //for loop for PI SERIES 4 { // loop start if (j>=2) //if staytment to check the j counter n++; // n=n+1 if the j>=2 serieValue3+= pow(+1.0, n-1)/pow(n,2.0); // Calculating pi of the 4trd series with for loop value of p …

Member Avatar for Akis2000
0
347
Member Avatar for Sky Diploma

Here is a comment stripper program from which takes input from Cin and removes the comments. [CODE=C++] #include <iostream> #include <fstream> char Getchar(); char var; int main() { char ch; do { Getchar(); switch(var) { case '/': switch(Getchar()) { case '*': Getchar(); while(true) { if(var=='*'&&Getchar()=='/') { break; } else { …

Member Avatar for tux4life
0
329
Member Avatar for mnkdpatel

[url]http://www.daniweb.com/forums/announcement8-2.html[/url] Please read the above. Here at Daniweb You need to post your code and then tell us where exactly you have a problem .

Member Avatar for iamthwee
0
79

The End.