6,741 Posted Topics
Re: >I need a getch(); which aint actually waiting for the input itself or in other >words, a function to simply return the value of the last pressed key. Try using a combination of kbhit and getch. I'll assume that you have those on your implementation because you mentioned them. >How … | |
Re: >I can't get anything to work on the hybrid version. Can anyone help, provide tips or pointers? Oddly enough, I posted the full implementation for an optimized quicksort in the code snippets on this site. One of the optimizations is terminating recursion on small subfiles and then calling insertion sort … | |
Re: >Is there an easy fix? Yes, make all of those variables double. If you declare them as integers then it would be a bad idea to pretend they are floating-point with an input function that takes you very literally. Since the decimal point is not a valid integer, cin is … | |
Re: Your problems all stem from this line: [code] vector<el> a(1); [/code] First and foremost you need to remember that any standard names are in the std namespace. If you don't have a using declaration (using std::vector;) or a using directive (using namespace std;) then you need to qualify the declaration … | |
Re: >for int (int i=0; i<MAX; i++)tabel[i]=i+1; [code] for (int i=0; i<MAX; i++)cin>> tabel[i]; [/code] >void main (void) In C++ this must be: [code] int main() [/code] You can keep the void argument, but it's really not necessary for symmetry like it is in C. But the important part is that … | |
| |
Re: I would be more worried about creating a button in the first place. No detail == no answer. | |
Re: >Help is greatly appreciated. Which parts are you having problems with? In the code you posted, tryAgain is missing a closing brace for the function body, so it doesn't compile. After that it does, but there are quite a few warnings ranging from type mismatches to unused parameters to uninitialized … | |
Re: Reducing a fraction is pretty easy with the GCD: [code] #include <iostream> using namespace std; int gcd ( int m, int n ) { return n ? gcd ( n, m % n ) : m; } int main() { int num, den; cout<<"Enter a fraction: "; cin>> num; cin.get(); … | |
Re: It looks like a faulty installation. Remove Visual Studio and try again, this time watching for any errors that crop up during installation. | |
Re: >because I couldn't figure out how to use the switch The switch is fine, it's the illegal nested function that's your problem. Functions cannot be defined within other functions. | |
Re: >Could you help me with this particular program Your question asks for help yet the rest of your post implies that you expect us to do it all for you. Try again. | |
Re: >but I need to call a function or another bool from inside a bool! Work on your terminology first, because I have no clue what you want. Let's get this straight, bool is a [b]type[/b]. bool has two [b]values[/b]: [B]true [/B] and [B]false[/B]. You don't call squat from inside a … | |
Re: Okay, first you need to decide how to represent the stack. A stack is an abstraction that can be represented a number of ways, the most common being either an array or a linked list. >please tell me how to enter no's in a stack This would be the push … | |
Re: >No ONE can answer this?!! [b]You[/b] can't answer it, why should you expect anyone else to? Anyway, have you tried something along these lines? [code] T ::= T, K, T | nil [/code] Or were you just waiting on someone else to do your research for you? | |
Re: Are you so impatient as to insult everyone on this board by starting a new thread when nobody answers your followup question on the other thread? It hasn't been that long. >I need to add a name in each of my arrays. You're thinking about the problem wrong. You need … | |
Re: >There is no need to take Naru's comments too serious. Anyone who takes me serious here is lazy, stupid, [b]and[/b] foolish. :D;) | |
Re: [code] <a href="link" onMouseOver="document.image.src='on.gif'" onMouseOut="document.image.src='off.gif'"> <img src="off.gif" name="image"> </a> [/code] It's pretty simple really, onMouseOver and onMouseOut are events that are triggered when the obvious happens: the mouse enters or leaves the image boundary. document is the current HTML file, image is the name of the image we're working with, … | |
Re: >warning: no newline at end of file Go to the end of the file and hit enter. Save and recompile. >undefined reference to `sin' Did you link to the math library? [code] gcc src.c -lm [/code] | |
Re: >pls solve me the following problem. No, do your own freaking homework you lazy bobo. | |
Re: How do you know that it doesn't work if you don't use the return value? :rolleyes: Try something like this: [code] int begins ( const char s1[], const char s2[] ) { int i; for ( i = 0; s1[i] != '\0'; i++ ) { if ( s1[i] != s2[i] … | |
Re: >Is it possible? Yes, by patching the libraries and executables you gave to the client, but this is not a topical question, so please direct your query elsewhere unless you have a specific problem concerning C or C++. | |
Re: >Can anyone help? What have you tried so far? Do you know how to get form fields and accept them as CGI input for your script? Do you know what platform your host server is using so that you can call the correct mailing program the correct way? | |
Re: >I can't open the program. program doesn't work. What program? Is this a reply to a thread and you just hit the wrong button? >If you have any different ideas please contact me. I have an idea, be more specific about your problem. But this is the only way I'll … | |
Re: >could any one give me the code for this... No, give it an honest try first, then try to cheat. | |
Re: >i have written this program the way my lecturer has teach us. You have my sympathy, your lecturer is a moron and clearly doesn't know enough to be teaching. | |
Re: >do you know how to make a program in C that can run the <snip> Yes, yes I do. >help me.. Glad to be of assistance. | |
Re: It depends on the language used. For C++ you will generally use a text editor to write the code, save it with a special file extension such as .cpp. Then you'll run it through another program called a compiler that will translate the code into machine instructions and spit out … | |
Re: If the object is myAC and the interface consists of turnOn and turnOff then there are only two things you can do with an existing object: call turnOn and call turnOff. The syntax to call a method of an object is a simple dot hierarchy <object>.<method>(<arguments>). Because turnOn and turnOff … | |
Re: >would u plz help me to learn graphics in C++ C++ doesn't support graphics natively. You need to choose a graphical library or API before someone can help you with it. A few good starters are Allegro, Qt, and SDL. A quick google search will give you reams of information … | |
Re: >Its called "C++ for Dummies." I've come to the conclusion that the "dummies" part of the title is referring to the author. I suggest you look at another book. :) I always recomment "Accelerated C++" by Koenig and Moo as an introductory text. >has anybody ever gotten the GNU program … | |
Re: >But I cant see where! That's because you're doing so much that could cause it! An access violation is when you access memory outside of your address space. This is most often caused by writing to uninitialized memory (through a pointer) or by overrunning the boundaries of an array (either … | |
Re: Let's look more closely at this: [code] list.count=0; moreData=getNext(list,0,pos); [/code] Notice how you set list.count to 0 and that the fromWhere argument is 0. Then in getNext: [code] if(fromWhere==0) { if(list.count==0) success=false; [/code] Both fromWhere and list.count are 0. Now back to printList: [code] while(moreData==true) { list.count++; [/code] moreData is … | |
Re: >cout << "loop.\n"; does this play any role or its just an output -> "n" I assume you mean \n. It's an escape character that tells cout to print a newline. >Why did we have to equal the min and max to number...? Which is 0? min and max denote … | |
Re: >Thanks for any help With what? You didn't ask a question. What do you want me to do, write you a book on all of the topics you mentioned? Or look into my crystal ball and give you information on the subjects that you need yet didn't deign to specify? … | |
Re: This is a problem with several parts. What you want to do is work on each part separately. First, work out a way to read words: [code] #include <cstdlib> #include <fstream> #include <iostream> #include <string> using namespace std; string get_word ( ifstream& in ); int main() { ifstream in ( … | |
| |
Re: >what kind of processor, mother board ect. do i need to get. It really depends. The processor and motherboard should be made for each other, such as an AMD motherboard with an AMD CPU. The motherboard depends on the case that you want. If you get a small case then … | |
Re: >It is the best X Box live game i have played Some of us actually played it before it was on the Xbox. :rolleyes: | |
Re: >I have to write an algorithm that decides if two structs are structurally equivalent. [code] #define equivalent(a,b) ( sizeof ( a ) == sizeof ( b ) ) [/code] It's as simple as that. Since you didn't specify what you mean by "structurally equivalent", we're free to assume that a … | |
Re: 1) Platform and implementation dependent. What compiler and OS are you using? 2) This is in [b]any[/b] book on C++. >please help...we haven't discussed it in class... You'll be in big trouble if you wait until everything is discussed in class before you do your own research. | |
Re: >what do I need to do to show the total of the divisors? Keep a running total. In StackOverflow's example, look at divisorSum that he neglected to declare. That's the general idea. | |
Re: >but it didnt work What were you expecting and what did it do that wasn't what you wanted? I can guarantee that you need more logic than that to mask a password entry. | |
Re: >how can i do this? By opening your Java book and figuring out how to do each of the parts of this program. Can you read a name and a message? Can you write a class to hold a message? Can you display text? Get that working with an array … | |
Re: Just FYI on the assumption that your teacher is an arrogant fool, like most of them seem to be: >#include <iostream.h> >#include <iomanip.h> These are not standard headers. You're probably using a compiler that is very old, so don't be surprised if you see something completely different from what you're … | |
Re: >I need help with designing and interface that will search keys. Your ability to describe the problem in detail is staggering. >use of avl trees ,b-trees One or the other? Both? For what purpose? Is the B-tree an external searching structure and the AVL tree an internal searching structure? Have … | |
Re: Let me check my helpful meanie guidebook. Hmm, "A double post warrants a sarcastic reply followed by stoney silence. Alternative actions are a brief flame and a pointer to google." Okie dokie. Search google and do your own damn research! I swear, people these days don't seem to be capable … | |
Re: You can find code for this all over the place. Here is how I did it a while back in response to a similar question: [code] #include <stdio.h> #include <string.h> char *wordbuild ( char *n, int ncomm ) { int i, nleft, len; char *p = NULL; static char ret[1024]; … | |
Re: >So is the random number genarator really random No. The random number generator creates pseudorandom numbers that just look good to a point. Depending on the quality of the generator that point will be quick to arive or not. >The weird thing is I get 4 like 6 out of … | |
Re: Try something like this: [code] #include <stdio.h> #include <conio.h> /* System dependent key codes */ enum { KEY_ESC = 27, ARROW_UP = 256 + 72, ARROW_DOWN = 256 + 80, ARROW_LEFT = 256 + 75, ARROW_RIGHT = 256 + 77 }; static int get_code ( void ) { int ch … |
The End.