2,827 Posted Topics
Re: [QUOTE=Q8iEnG;648116]Sorry, I meant the error message this one [url]http://img353.imageshack.us/img353/4592/60491933en2.jpg[/url] I'm using Microsoft Visual C++ and there's no message for the debug!! So, is it now clear my friend? I hope you'll be able to determine *kindly* the mistake in the code :shy:[/QUOTE] You need to supply dictionary.txt. This program can't … | |
Re: [QUOTE=winterx;648081]it is not calculating the correct average....[/QUOTE] Post your updated code, formatted and with code tags, explain exactly what the program is SUPPOSED to do and explain exactly what the program is doing that is incorrect. Tell us what input you have entered and what the desired output should be. … | |
Re: [QUOTE=ctrl-alt-del;647648]Thanks all! I know it isn't necessary to watch the grammar and all that but for once.. I'd like to make an effort for it and see if I can make a habit of doing it ;) (I'm also a bit of a smiley-slut.. that'll never change I'm afraid :D) … | |
Re: [QUOTE=faisaly;647747]Dear All, Write the pseudo code for inserting a node in threaded binary tree. You code should describe how you will, 1. Set right and left child node pointers during insertion 2. Set right and left flags during insertion. Kindly guide me .[/QUOTE] Is this you, or someone in the … | |
Re: [code=JAVA] public class hmwrk2 { public class lp { public int first; public lp rest; public lp list1; public lp(int first1, lp rest1) { first = first1; rest = rest1; } } //15 public static void count_list(lp list1) {int count = 0; while (list1 != null) {count++;} return count; } … | |
Re: [QUOTE=sambafriends;647474]Hi thank u for ur replay I need the program which is like this [code=C++] struct stack { int top; int a; }; stack e1; e1.top=-1; e1.a=45; [/code] In the above program the top not become -1, i.e., we can't give the importance to the data just like that, I … | |
Re: I wouldn't start coding it yet. Write the algorithm out on paper first till you get a good feel for it. This is as much of a mathematics/statistics problem as it is a computer programming problem. First realize that in a number like: 42276 you are dealing with four possible … | |
Re: [QUOTE=Alex Edwards;647250]Is it possible to send something like, a Frame or Applet to a target computer? If not, how would I set it up so that two users from two different computers could interact with the same JFrame or JApplet? Edit: No I'm not asking for code, just general advice*[/QUOTE] … | |
Re: [QUOTE=gangsta gama;645761]Thank you Alex and iamthwee. Your posts were very helpful, I will keep them in mind, but I am wondering how to write [U]variables[/U] to files. If you are confused(I know I am probably not clear enough) I have an example code posted below [CODE]#include <iostream> #include <fstream> #include … | |
Re: [QUOTE=Shadoninja;645858]Could someone write an example program that opens up firefox? I would really like to see the syntax to do that. Thanks[/QUOTE] Check out this recent thread too. [url]http://www.daniweb.com/forums/thread133844.html[/url] | |
Re: [QUOTE=CoolGamer48;644726]I see. But is that really all the useful? I mean what's the benefit of that method over using an array and the [] operator?[/QUOTE] Well I don't know how useful this is to others (it's been useful to me though) and whether you can do it in Java or … | |
Re: [QUOTE=anuizath2007;644493]in this program...if i want to rank the students on the basis of their total marks wat do i do?...i mean where do i assign the rank.....[/QUOTE] Well I would imagine that you would sort the records by Total before displaying them. So use any sorting algorithm you like, but … | |
Re: [QUOTE=oali;643984]sory bout not using code tags i'm new never actually used the forum, are these code tags [] thanks for the help by the way[/QUOTE] Code tags... [noparse] [code] // paste code here [/code] [/noparse] or [noparse] [code=JAVA] // paste code here [/code] [/noparse] Here's your code, formatted with code … | |
Re: [QUOTE=Ancient Dragon;644940]A c++ compiler will produce errors on that code because in order to overload a function the parameters must be different. In the code you posted both versions of the function have the same identical parameters. So your question is moot because that code can not be compiled.[/QUOTE] Actually … | |
Re: I believe that the problem is that there is some overhead when calling that action listener when the timer fires. It seems to me, at least on my computer, that every time the timer fired, 25 milliseconds elapsed that was not timed. My guess, and it's only a guess, is … | |
Re: [QUOTE=SilentlyShaken;645110]It does? When i run it it has no mistakes at all, just doesn't restart. But you can go ahead and delete it.[/QUOTE] I don't know if FTProtocol was referring to your code. He might have been referring to his own for all I know. ivailosp actually "solved" it for … | |
Re: [QUOTE=vsha041;644859]Hi, I am trying to run this code, but after the program runs, it is never asking me to enter something, instead, it just finishes. [CODE] #include <iostream> #include <string> using namespace std; int main () { string str; cout << "Please enter full name: "; getline (cin,str); cout << … | |
I'm trying to get my hands around Forms Painting in Visual C++, so I've created a Form, and on that Form I have added a Panel called cityPanel. I'd like to paint a green rectangle on it. I double clicked cityPanel, which resulted in Visual C++ creating this new function: … | |
Re: [QUOTE=Xjmaslord4;643975]It is and it doesn't have to be A+ materialim on my summer vacation right now and my mom is making me do this>_> so i picked something easy so are you going to help me or not?[/QUOTE] You have to expect a least a little ribbing when you say … | |
Re: Get rid of iostream.h and conio.h. They're outdated. Use iostream instead of iostream.h. Don't use getch(). Use [ICODE]cin.get()[/ICODE] instead and you won't need conio.h. Change [ICODE]void main()[/ICODE] to [ICODE]int main()[/ICODE] and have main [ICODE]return 0[/ICODE]. Repost your updated code using proper code tags: [noparse] [code=cplusplus] // paste code here [/code] … | |
Re: [QUOTE=twburkle;642483]Here is some of my code at the moment. After narrowing some google searches, Array's look like should be able to accomplish what I need. 1. Can I assign an Array's element to one gross income, then use a loop to assign the next one? If so, is it as … | |
Re: [QUOTE=QuantNeeds;642359]I see. I was wondering, do you know if the prompt command box will delete initial output if the information being printed is too long or will it keep the entire history? It keeps chopping off and I am not sure if it’s something that I am doing wrong or … | |
Re: How much longer is the code if you include main and the .h file? We can't compile and run it without them so you might want to post them too. Thanks. | |
Re: [QUOTE=sarehu;640924]What do you think of this? [url]http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml[/url][/QUOTE] This looks like a great link! I've bookmarked it. I was looking at the threads pinned to the top and noticed that there is one at the top regarding C++ books, but not C++ websites. I think one should be started and this … | |
Re: [code=cplusplus] for(quantity;quantity > 0; quantity--) { cout<<"Please enter a number: "; cin>>largest; cout<<endl; for(quantity;quantity > 1; quantity--) { cout<<"Please enter a number: "; cin>>num1; cout<<endl; if(largest<=num1) largest=num1; } } [/code] This code looks strange to me. You have a nested for-loop that uses the same variable name (quantity) as the … | |
Re: [QUOTE=ferzan;641861]Hello, I'm embarrassed for asking this question but for the life of me I cannot find an answer. This ultra simple code is giving this error as well as any other function that I'm trying to write. [CODE]a function-definition is not allowed here before '{' token expected `,' or `;' … | |
Re: Try changing this code in your Breeture class: [code] vector<*Breeture> parents; vector<*Breeture> children; vector<*Breeture> partners; [/code] to this: [code] std::vector<Breeture*> parents; std::vector<Breeture*> children; std::vector<Breeture*> partners; [/code] | |
Re: [QUOTE=skatamatic;635511]Ok. Originally I was trying to write a program that would calculate pi to infinite decimal places. The calculus baesd algorithm I made for this is flawless, except that C++ can only handle 16 digits! So I did some looking around, for libraries and what not, to find something that … | |
Re: [QUOTE=newbiecoderguy;639535]I want this program to calculate an actors age at the time a movie they made was released, the user inputs all the data... I dont know C just learning but this is the layout I thought of any help would be appreciated, this does not compile [CODE]#include <stdio.h> int … | |
Re: [QUOTE=nokeekon;640250]How do you make the value stay every time you run the .exe?[/QUOTE] Write the value to a file. Read from the file using an ifstream at the beginning of the program. If the value changes during the program, write that new value to the file using an ofstream before … | |
Re: [QUOTE=mikelle;636336] [code] while (cin >> hours) [/code] [/quote] I assume that you don't mean cin here, but rather inFile? Or does the user enter hours? [QUOTE=mikelle;636336] [code] cout << fixed << showpoint << setprecision(2)<< endl; cout << employee << hours << payrate << taxbracket << exemptions << endl; cout << … | |
Re: [QUOTE=Evan M;639537]I have a function which takes an array of SDL_Rect (which is a data structure containing four integers, x, y, h and w), and assigns values to the data members. However, when I try to compile, each line generates the error "error C2059: syntax error : '='". [CODE] int … | |
Re: I would actually take the nxt data attribute out of the Student class and put it in the StudentList class. It gives you far more options and is generally the way things are done What if you want a student to be in two or more separate lists? The "next" … | |
Re: What's LinkList? Is that some compiler-specific library/class? Something you wrote yourself? Same question for the insert function. Where is it? Did you write it yourself? If it's something you wrote yourself, please post it. If not, please explain where it's from. I for one have never heard of it. [QUOTE=Q8iEnG;638346]Hi … | |
Re: I think it's this thread. I just took the thread number from the link and typed it in: [url]http://www.daniweb.com/forums/thread19348.html[/url] | |
Re: [QUOTE=adamj2;630875]Hi there, What I am trying to do is implement my own sequence number program. I have a sequence number i.e 0001 and then I try to convert this to a binary string in byte format of 4 bytes: 00 01 00 00 And then I am appending this in … | |
Re: [QUOTE=lich;637930]Here is my code import java.io.*; class Add { public static void main (String args[] ) throws IOException; { BufferedReader br=new BufferedReader( new InputStreamReader (System.in)); System.out.println("Enter the value of X:"); int x=Integer.parseInt(br.readLine()); System.out.println("Enter the Value of Y:"); int y=Integer.parseInt(br.readLine()); int z=x+y; System.out.println("\n\nValue of X + Y = " +z); } … | |
Re: [QUOTE=GrimJack;634086]So, what do the denizens of DaniWeb think about gay marriage in California? The forces for both sides are gearing up for an initiative fight in November that might be more expensive than the presidential battle in the state. The LDS (Mormon), Catholics, and Baptists are contacting all their bishops … | |
Re: [QUOTE=QuantNeeds;637749]I'm sorry I'm confused. I think I know what you are saying but I do not know how to implement it. And also why would I have some other functions. And if I have a reference then I need to initialize it.[/QUOTE] I don't see a call to the [ICODE]test()[/ICODE] … | |
Re: [QUOTE=Q8iEnG;637617]No, of course with recursion but in the method I displayed!![/QUOTE] If you are using recursion, don't use the for-loop. You'll just want a single call to the function from main. You mentioned even versus odd exponents, but actually do you need the exponent to be a power of 2? … | |
Re: [QUOTE=QuantNeeds;637567]Well would the following also be correct? I made some changes and by not using the constructor I was able to get it to work. However, now I am wondering if I am testing the function for accuracy correctly? You would figure rolling a 7 would appear 6/36 times (so … | |
Re: [code=cplusplus] void AmasiVillage() { CharacterLocationID = 1; system("cls"); cout << "\n"; cout << "\n"; cout << "\n"; cout << "\n"; cout << " Amasi Village\n"; cout << "\n"; cout << " 1)Travel to Koru\n"; cout << " 2)Travel to Reya\n"; cout << " 3)Maktor Ride to Drasin Citadel\n"; cout << … | |
Re: It's a warning, not an error: [code=cplusplus] bool Wagering::wageringTest(double currentWager, double currentBankBalance) { if (currentBankBalance > 0) { while(currentWager <= currentBankBalance) { return true; } } else if(currentBankBalance < 0) { return false; } } [/code] You can change the "while" to an "if" in line 5. You'll never repeat … | |
Re: [QUOTE=CheesyBeefy;637200]Hey everyone, I'm new to the forums here, and also new to C++ and hoping to get some help. In my code, I want a random number to be displayed but in between two numbers. (ex. with my code, it generates a huge random number in the thousands, I only … | |
Re: [QUOTE=cyrinius;636724]Also what is the difference between visual C++ and just C++. Also, kinda wanting something more than online tuts, i need some professional help on C++.[/QUOTE] If you want professional help (i.e. looking to hire someone) you may want this forum: [url]http://www.daniweb.com/forums/forum72.html[/url] Regarding where to start, generally you start with … | |
Re: The output for the second is actually this: [code] 10 9 8 7 6 5 4 3 2 1 0 0 0 etc... [/code] You can't see the first ten numbers since they go by too fast. Try putting a pause in there. Hit the enter key repeatedly. [code] //Using … | |
I am using Windows XP SP II and Visual Studio 2008. I've created a little program that I'd like to run when the computer boots. Here is the code: [code=cplusplus] // dummy1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <fstream> #include <string> … | |
Re: Yes, that C code is definitely not pretty! Seems to me that if you want to store the hex number as a String containing characters '0' through '9' and 'a' - 'f' and the corrsponding binary number as a String containing characters '0' and '1' (that appears to be what … | |
Re: [QUOTE=garblund;636637]I have Visual C++ 2008 Express Edition and I am just trying a sample program to see what happens when it is run. I just don't know what to do to compile it. All the examples I have seen so far don't help. Some show going to "Build" on top … | |
Re: [QUOTE=ladyscoleman;636103]numberArray[1][1] = "value 2"; numberArray[1][2] = "value 4; numberArray[1][3] = "value 1"; numberArray[1][4] = "value 2"; numberArray[1][5] = "value 2"; numberArray[1][6] = "value 1"; numberArray[1][7] = "value 1"; numberArray[1][8] = "value 1"; numberArray[1][9] = "value 1"; am I on the right path here?[/QUOTE] Not sure what you are doing here. … |
The End.