6,741 Posted Topics

Member Avatar for Anu

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

Member Avatar for vegaseat
0
230
Member Avatar for Jpowers22

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

Member Avatar for subtronic
1
3K
Member Avatar for hill0ster

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

Member Avatar for Narue
0
125
Member Avatar for jasweb2002

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 …

Member Avatar for jasweb2002
0
100
Member Avatar for JoBe

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

Member Avatar for Narue
0
133
Member Avatar for awaz_16
Member Avatar for Eforcers
1
165
Member Avatar for skywing

I would be more worried about creating a button in the first place. No detail == no answer.

Member Avatar for vegaseat
0
150
Member Avatar for hill0ster

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

Member Avatar for Narue
0
167
Member Avatar for dontcare

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

Member Avatar for dontcare
0
155
Member Avatar for mohammad

It looks like a faulty installation. Remove Visual Studio and try again, this time watching for any errors that crop up during installation.

Member Avatar for Narue
0
70
Member Avatar for dontcare

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

Member Avatar for dontcare
0
157
Member Avatar for jasonburgess

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

Member Avatar for Narue
0
102
Member Avatar for hill0ster

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

Member Avatar for Narue
0
476
Member Avatar for arizona24

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 …

Member Avatar for Narue
0
138
Member Avatar for HSN

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

Member Avatar for Narue
0
108
Member Avatar for HollywoodTimms

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 …

Member Avatar for Narue
1
484
Member Avatar for V5dave

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

Member Avatar for Narue
0
394
Member Avatar for hammy

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

Member Avatar for hammy
0
377
Member Avatar for trashed

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

Member Avatar for trashed
1
190
Member Avatar for shantuli

>pls solve me the following problem. No, do your own freaking homework you lazy bobo.

Member Avatar for tigerxx
0
109
Member Avatar for Alfy

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

Member Avatar for Alfy
0
119
Member Avatar for srinivasvs

>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++.

Member Avatar for Chainsaw
0
188
Member Avatar for microsoftne

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

Member Avatar for Narue
0
78
Member Avatar for bemrag

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

Member Avatar for Dave Sinkula
0
111
Member Avatar for zoey

>could any one give me the code for this... No, give it an honest try first, then try to cheat.

Member Avatar for Narue
0
150
Member Avatar for pratima

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

Member Avatar for clartsonly
0
150
Member Avatar for felcris_pf23

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

Member Avatar for alc6379
0
120
Member Avatar for adzidzor

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 …

Member Avatar for vegaseat
1
171
Member Avatar for Ghost

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 …

Member Avatar for Narue
0
220
Member Avatar for mishu1516

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

Member Avatar for vegaseat
1
201
Member Avatar for Young Teck 06

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

Member Avatar for Young Teck 06
0
167
Member Avatar for michal

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

Member Avatar for Narue
0
483
Member Avatar for ohnbabygal

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 …

Member Avatar for Narue
1
196
Member Avatar for wangstarr

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

Member Avatar for Narue
1
146
Member Avatar for jlopes151

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

Member Avatar for Narue
1
125
Member Avatar for HinJew

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

Member Avatar for Narue
1
113
Member Avatar for h3rtz
Member Avatar for Junior89

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

Member Avatar for Catweazle
0
241
Member Avatar for Junior89

>It is the best X Box live game i have played Some of us actually played it before it was on the Xbox. :rolleyes:

Member Avatar for Narue
0
89
Member Avatar for hansamurai

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

Member Avatar for Narue
0
117
Member Avatar for potential

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.

Member Avatar for Narue
0
312
Member Avatar for tonja1196

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

Member Avatar for tonja1196
0
110
Member Avatar for dooda man

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

Member Avatar for FireNet
0
134
Member Avatar for raneka17

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

Member Avatar for raneka17
0
170
Member Avatar for hopeolicious

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 …

Member Avatar for Narue
0
131
Member Avatar for dunga

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

Member Avatar for Narue
0
97
Member Avatar for Him3

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 …

Member Avatar for Narue
0
141
Member Avatar for plasmafire

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

Member Avatar for plasmafire
0
172
Member Avatar for server_crash

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

Member Avatar for felgall
0
138
Member Avatar for dooda man

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 …

Member Avatar for Narue
0
372

The End.