6,741 Posted Topics

Member Avatar for dja

I've never heard of your problem before. Sorry. >Or perhaps a link to a decent/free compiler that I could use? [url]www.google.com[/url]. Search for Dev-C++ or Bloodshed.

Member Avatar for Narue
0
101
Member Avatar for Geek-Master

>I need a function that does the same thing as both CLS and Clear. [code] #include <stdlib.h> #include "system.h" void clear() { #if defined(DOS_BASE) system("CLS"); #elif defined(UNIX_BASE) system("clear"); #else #error Unsupported system #endif } [/code] Will it work? Probably, provided you define either DOS_BASE or UNIX_BASE in system.h. Is it …

Member Avatar for Narue
0
633
Member Avatar for JoBe

There's nothing wrong with your code aside from formatting and redundant braces. Though the last loop could simply be an assignment because all you're doing is adding dag to amount. Here's how my first attempt would do it: [code] #include <cstdlib> #include <iostream> using namespace std; int main() { const …

Member Avatar for Narue
0
306
Member Avatar for PascalRookie

>This is due tomorrow Bummer. >and i am absoltuly lost Try paying attention in class. >can anyone help with some examples or point in the right direction Sure, post your attempt and we'll help. Nobody is going to do your homework for you. Especially since it seems like you're terribly …

Member Avatar for ediehm
0
326
Member Avatar for Diod
Member Avatar for jeanatkin

>How do I get to compile it in DOS? Are you [b]using[/b] DOS? Or are you one of the many ignorant people in the world who think that the Windows command prompt is DOS? You really are behind the times by many years. There are many superior alternatives to BGI …

Member Avatar for jeanatkin
0
246
Member Avatar for JoBe

Don't use the physical size of the string as your limit, use the logical size. The physical size is the size of the array while the logical size is determined by where the terminating null character is: [code] #include <algorithm> #include <cstring> #include <iostream> using namespace std; void sreverse(char *s) …

Member Avatar for JoBe
0
171
Member Avatar for nico

Two virtually useless replies it seems. Dancing around the problem isn't very helpful. Let's cover the first reply: >system("PAUSE"); // in <cstlib> i believe. Bad suggestion. I've explained why before. >getchar(); // in <cstdio> And this is different from cin.get()...how? The only difference is that now you don't attempt to …

Member Avatar for Acidburn
0
140
Member Avatar for ahmed_design

What an awful question. You make it difficult to tell if it even IS a question, then follow up with a ridiculously vague reference to an acronym that you don't even bother to put in caps. Did you really expect to get any answer other than the one I'm about …

Member Avatar for Dani
0
164
Member Avatar for hruzam

Delete the files from within VC++, then go to the project folder and kill them there too.

Member Avatar for hruzam
0
340
Member Avatar for Tom Pilk
Member Avatar for fakhre

Argh! Why must you people fill my brain with hurting!? And people ask me why I'm angry all of the time. I direct rage at anyone who insults the effort I put into learning how to use C properly. Too much bad code, going somewhere else to cool off now...

Member Avatar for Dave Sinkula
0
377
Member Avatar for kellyandtopher

Every function declaration should have the following structure: [code] return-type name(optional-parameters); [/code] Every function definition should have the following structure: [code] return-type name(optional-parameters) { } [/code] A function can return void if there's no meaningful return value, and it can accept no parameters if there's no need to: [code] int …

Member Avatar for yb1pls
0
129
Member Avatar for jdl44lfhs

>I was just looking for some help thats all We'll be happy to help, when you ask a question that doesn't resemble "Help me with the problem I just pasted but haven't actually tried to solve yet". >I just heard that this is a really good well-established website on helping …

Member Avatar for jdl44lfhs
0
210
Member Avatar for serfurj

There's a language standard that compilers are pretty much required to support if they want any market share, but the language definition also allows for non-standard extensions. Every compiler out there will take advantage of this allowance, so code that uses extensions will not be portable across compilers. The same …

Member Avatar for serfurj
0
158
Member Avatar for Nabs

isdigit(cin.peek()) is basically the same thing as [code] char ch; cin.get(ch); isdigit(ch); cin.unget(); [/code] It returns the next character on the stream and then tests to see if it's a valid numeric digit without removing the character from the stream.

Member Avatar for Narue
0
84
Member Avatar for rangers10

>i just need someone to point me in the right direction. [code] int main ( void ) { return 0; } [/code] >but the problem is that i need it to subract the highest and lowest numbers then add the remaining numbers left. What have you tried so far? Have …

Member Avatar for alc6379
0
163
Member Avatar for jeannette1960

>help with getting soda machine program running [code] bool fix ( const soda_machine& machine) { kick ( machine ); slap ( machine ); shake ( machine ); curse_at ( machine ); return machine->is_working; } ... if ( !machine.is_working && !fix ( machine ) ) call_repairman ( machine.serial_number ); [/code] But …

Member Avatar for Dave Sinkula
0
243
Member Avatar for gallas

>1. I've heard that using pointers makes it much more difficult for the compiler to optimize code. You heard wrong. [b]If[/b] a compiler fails to optimize pointers properly, it's extremely unlikely that all other compilers do as well. >so in this case I'd say that the pointer referencing is unwanted …

Member Avatar for jwenting
0
198
Member Avatar for lizjci

>im studying programming fundamentals.. Then why are you learning C? >pls can u give me some definition and information about c language Get a good book. Online tutorials have a tendency to suck ass. A good tutorial/reference book is [I]The C Programming Language[/I] by Kernighan and Ritchie.

Member Avatar for Sphyenx
0
714
Member Avatar for anastacia

>if it is ..... it should be system("cls"); No it shouldn't. Then you would add two problems to already nonportable code. If a screen clear is warranted, then it should be changed to something that the implementation supports, preferrably by doing something like this to make porting easier in the …

Member Avatar for acsinha
0
188
Member Avatar for supra

>I want to learn Java Servlets, Oracle 8i & Linux Administration. Cool. >I have tried the Sun's site for Java but I can not follow it. I assume you started [url=http://java.sun.com/learning/new2java/index.html]here[/url] and then moved on to [url=http://java.sun.com/learning/tutorial/index.html]here[/url]? If that's too much then you really should get a good beginner's book. …

Member Avatar for Sphyenx
0
122
Member Avatar for BSaltturk

>It would become a lot easier if you use list<string> instead Agreed. >and fstream functions for the file handling Many feel that C++ streams are too awkward and opt for FILE *'s instead. I can understand that feeling for most common uses. >void main (void) First, main doesn't return void. …

Member Avatar for khuman_nb
0
1K
Member Avatar for Sideshow Bob

What kind of problems are you having? I can think of at least three big reasons off the top of my head why a Java server couldn't communicate properly with a C++ client.

Member Avatar for Sideshow Bob
0
172
Member Avatar for harshchandra

>Can anyone tell me the complete algorithm analysis of Tower of Hanoi Sure: [code] #include <iostream> using namespace std; int main() { cout<<"I'm too lazy to do my own work\n"; cout<<"I'm too stupid to realize that nobody will do my work for me\n"; cout<<"I'll never amount to anything because I'm …

Member Avatar for harshchandra
0
269
Member Avatar for Dani

>What exactly are we returning as a pointer to an integer? The shortest path, basically an array of x,y pairs. >Are we making changes to the two arrays that are passed in with each iteration? No, those arrays simply tell you what the distance between two points is. >Try going …

Member Avatar for Chainsaw
0
192
Member Avatar for naya

I have a better idea. You prove that you've tried to solve these problems on your own, and we'll help you with any errors. No one is going to do your homework for you.

Member Avatar for harshchandra
0
122
Member Avatar for skeet123

To remove a node with two children you need to find the inorder successor or predecessor to replace it with, then reduce to the case of removing the successor or predecessor. A fairly thorough tutorial on binary search trees can be found [url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1073433376&id=1073086407]here[/url].

Member Avatar for Narue
0
131
Member Avatar for missy

>how do you convert to binary. Try using printing 1 if val % 2 is not 0 and 1 otherwise, then divide val by 2 and repeat until val is 0. This should give you a good start toward the solution.

Member Avatar for Narue
0
117
Member Avatar for Der_sed

>but y doesnt the "do while" loop terminate upon entering "\r" (enter) cin's >> operator terminates on whitespace. \r and \n are whitespace, so ch and sold will never have those values, the program will simply sit there waiting for input until it gets something it likes.

Member Avatar for vegaseat
0
188
Member Avatar for Der_sed

>dear use function Dear, don't suggest nonportable functions unless you know that they're supported and acceptable solutions. >I AM ONLY ABLE TO ALIGN THE TRIANGLES VERTICALLY AND NOT HORIZONTALLY For each row, handle all of the triangles rather than just one: [code] #include <iostream> using namespace std; int main() { …

Member Avatar for Narue
0
143
Member Avatar for mattcplusplus

>the variable is maintained and is available for future calls of the function in which it has been declared However, this isn't as useful as it appears at first.

Member Avatar for Narue
0
191
Member Avatar for thiodre26

>I am attaching my .cpp file. Don't do this. Post the code. If the code is too long, post relevant pieces. Your attachment is very small, so the code is short enough to post.

Member Avatar for Chainsaw
0
95
Member Avatar for slavic1

>How would I create a method like toString() within the SHA-1 class Try using a stringstream with the hex modifier: [code] #include <iostream> #include <string> #include <sstream> using namespace std; int main() { ostringstream oss; char ch = 'a'; cout<< ch <<" -- "<< hex << static_cast<int> ( ch ) …

Member Avatar for Narue
0
107
Member Avatar for BSaltturk

What problem are you trying to solve with this code? It appears as if you want to take a list of strings, then print out whether or not the each unique string is a palindrome. >/* Counting duplicates */ This isn't entirely truthful. It looks more like you're [b]removing[/b] duplicates …

Member Avatar for Narue
0
90
Member Avatar for missy

>i don't understand how to do this. You should have paid attention in class then.

Member Avatar for Narue
0
145
Member Avatar for N3wbi3C0d3r

>Any ideas whats wrong? Too much. There's no point in trying to fix something so broken, so start over, and this time use a C++ reference.

Member Avatar for jwenting
0
146
Member Avatar for matt_5104

It sounds like a scope issue where the Calculations object whose values you're setting is being destroyed and then recreated. When you access the values, they're fresh from the constructor.

Member Avatar for tozaheer
0
126
Member Avatar for joey15

>Does anyone know where I can find an example of the code? The following is a good description with C code. Fortunately, the differences are only in details. You can easily figure out how to translate the algorithm to Java. [url]http://www.stanford.edu/~blp/avl/libavl.html/Balancing-a-BST.html[/url] Alternatively, you could get a membership with the ACM …

Member Avatar for joey15
0
1K
Member Avatar for Faramba

>How can we print the output of the program Print to a printer device, you mean? There are probably issues involved that you aren't aware of, so writing directly to a printer stream isn't the best idea. It would be much better to search your documentation to find a nice, …

Member Avatar for Extreme
0
94
Member Avatar for jcr1

>according to my notes its right And your notes have to be correct? Nope, sorry. >void main() int main ( void ) >int enter_operator; char enter_operator; >scanf ("%d",&enter_operator); scanf ("%c",&enter_operator); >if (enter_operator = +); if (enter_operator == '+') >if (enter_operator = -) else if (enter_operator == '-') >} return 0; …

Member Avatar for alc6379
0
464
Member Avatar for Domainstop

>Is something wrong with my software, or something? Sure, blame the software for your misunderstanding of the language. >void main() {} should also be accepted even though it's not good practice. You should start telling people that it's WRONG. That way they may actually stop using it. The official rules …

Member Avatar for Tresa
0
178
Member Avatar for fivetoesonefoot

>how long did that take you? The real question is how long will it take him to realize that doing your homework for you was a mistake. >i owe you big time No, you don't. The code you were given would get me fired, and it'll probably get you a …

Member Avatar for Tresa
0
203
Member Avatar for monicaden

>does that work? >also i keep gettin a compile error Hmm, if you get an error then it probably doesn't work. >polyg & polyg::operator=(polyg& pg);//5 Remove the semicolon.

Member Avatar for Narue
0
100
Member Avatar for grifflyn

>how would i tell the program to output 5 stars instead of the number 5 [code] for ( int i = 0; i < 5; i++ ) System.out.print ( "*" ); [/code]

Member Avatar for grifflyn
0
114
Member Avatar for Alfy

>i was wondering what i did wrong Start by getting the sorting algorithm correct with simple test cases. All of the framework is only going to make debugging harder. But I can tell you right now that your algorithm is wrong. Check my sorting routines entry in the Code Snippets …

Member Avatar for jwenting
0
172
Member Avatar for kiki021600

>I am confused about where it will be getting files from? The program will be executed like this: [code] $ mycat file1 file2 file3 [/code] For the purposes of your assignment, you can assume the following for argc and argv of main: [code] argc = 4; argv[0] = "mycat"; argv[1] …

Member Avatar for Narue
0
1K
Member Avatar for Young Teck 06

>Does anybody know if this software is great It works fine for my purposes. >what are the best features of it It works fine for my purposes. ;) >Other recommendations are also welcome. Borland C++ 5.5 and Dev-C++ are both free and good quality.

Member Avatar for vegaseat
0
366
Member Avatar for LoLo

Multiple threads with the same question in less than a day means no answer for you. Figure it out on your own if it's that urgent.

Member Avatar for LoLo
0
121
Member Avatar for Dounia

>Here is what i solved so far Nice, you managed to write a bit of framework, but none of the solution at all. Be more specific about what the homework entails and I might help.

Member Avatar for Dounia
0
171

The End.