- Strength to Increase Rep
- +17
- Strength to Decrease Rep
- -4
- Upvotes Received
- 2K
- Posts with Upvotes
- 2K
- Upvoting Members
- 627
- Downvotes Received
- 169
- Posts with Downvotes
- 145
- Downvoting Members
- 113
6,741 Posted Topics
Re: You don't set RAND_MAX, it's a constant value (usually 32767). I don't see why you would want to set it unless the range is too small for you (in which case you use a better random number generator). Tell us how you're trying to go about solving the problem, show … | |
Re: Create an array of questions and use the random number as an index for the array. | |
Re: >why? Because when you use void main, your code is no longer guaranteed to compile or run. The C standard specifies two definitions of main, and you should use one of those unless you have a [I]very[/I] good reason not to: [code=c] /* When expecting no command line arguments */ … | |
Re: >Its only drawback is that, while it mentions bogosort, it doesn't give an implementation. For two reasons. First, there's little point in providing an implementation of a sort that would never be used in practice. My site is about practical programming. Second, bogosort is a pain to verify for correctness. … | |
Re: [QUOTE]can you please tell me short and best answer so that i can understand it more clearly...[/QUOTE] Compilers are not required to support anything but the following two definitions of main (equivalent definitions are allowed though): [code] int main() { ... } [/code] [code] int main(int argc, char *argv[]) { … | |
Re: >wat is echo?? In this case, echo means that when you type a character, it prints to the screen so you can see what you typed. | |
Re: Ethical hacking is the practice of penetrating security (usually with the owner's consent) for the purpose of improving it rather than taking advantage of weaknesses for personal gain or malicious reasons. | |
Re: It looks like you're on the right track. Do you have a specific question? | |
Re: [quote] Bleach Naruto FMA Samurai Champloo Samurai 7 [highlight]Onegai Teacher Onegai Twins[/highlight] Hellsing Samurai X [/quote] That's a pretty sudden switch. Aren't both Onegai Teacher and Onegai Twins romantic comedies? | |
Re: >Is this possible in vb.net Of course. It's not like you're doing anything exceptionally complicated, but it [I]will[/I] be tedious. Kanji is symbolic and based on concepts/words while katakana is based on syllables. There's really not an algorithm for breaking kanji down into katakana, so you have to take all … | |
Re: >Below is my source code but I am getting errors stating invalid conversions. Post the errors. | |
Re: >But the more I seek for that the more I understand >how super impossible that is in this sad world... Then learn "great machine code programming" and be your own friend. Because with that attitude, your standards are too high for real friends. | |
Re: >What's the HARDEST program you've written? Operating system. Well, technically I didn't write it, but I did patch it into behaving and that consisted of replacing about 90% of the code. | |
Re: That seems kind of silly to me. The point of a checksum is to verify the legitimacy of a file after downloading it. If you're getting the checksum before downloading the file it's no different from taking on faith that the file is legit in the first place. | |
Re: Alternatively, use isprint to determine if there's a printable representation of the character, and show the numeric value if there is not. | |
Re: [QUOTE]I regard hielo's non-responsive response as an attempt to bully a newbie.[/QUOTE] I'm sorry you feel that way, but nothing in hielo's post constitutes bullying. Your use of code tags made the code more difficult to follow (for which he suggested a fix), and frowny faces embedded in the code … | |
Re: [QUOTE]all i could find, peaople saying: it depends on the os, compiler, etc[/QUOTE] When you rely on compiler-specific features, that's the correct answer. For textcolor(), the portable replacement (for Windows platforms) is [URL="http://msdn.microsoft.com/en-us/library/ms686047(v=vs.85).aspx"]SetConsoleTextAttribute()[/URL]. For delay() and sleep() the portable replacement (also for Windows) is [URL="http://msdn.microsoft.com/en-us/library/ms686298(VS.85).aspx"]Sleep()[/URL]. [QUOTE]Please write a proper answer, … | |
Re: I see several problems, but the most likely one you're encountering is this: [code] int bank::accno=0; [/code] accno doesn't exist in the class. The only static data member is called accnumber, so I can only assume the mixup is a brain fart. Make sure all identifiers match up and it … | |
Re: [QUOTE]What is meant by STEP-COUNT METHOD?[/QUOTE] You define what a "step" means for the algorithm (usually statements), then the total of those steps using variables such as N can be calculated. [QUOTE]What is the procedure in that to calculate?[/QUOTE] [list] [*]First define steps: [code=c] int mean(int a[], size_t n) { … | |
Re: >I'm not quite sure the difference between strcmp and == operator when comparing 2 different strings Presumably you're using C-style strings, otherwise strcmp wouldn't be an option. So with that in mind, you should use strcmp because it compares the contents of the strings while == compares the address of … | |
Re: You write your code in the text editor of your choice, then pass the text file to NASM for assembly. | |
Re: I'm impressed. You actually made it 5 posts before turning into a total d'bag. Most of your kind don't make it two posts, so I'd say you have some potential in being a normal, well adjusted member of society. With some effort, of course. | |
Re: [QUOTE]Simple example adding two numbers is[/QUOTE] Clearly you don't understand what the OP is asking. The problem is to add two numbers that cannot be stored in any integer type. It's an exercise in [URL="http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic"]arbitrary precision arithmetic[/URL]. | |
Re: >How to calculate time complexity of any algorithm or program .... The most common metric for calculating time complexity is Big O notation. This removes all constant factors so that the running time can be estimated in relation to N as N approaches infinity. In general you can think of … | |
Re: >You are relying upon that program (pause.exe) being available You're also relying on that program doing what you expect it to do. The problem is that one can easily replace pause.exe with another program of the same name but a malicious payload. [ICODE]system("pause");[/ICODE] isn't portable, but the real kicker is … | |
Re: What's the range of int? I bet not enough to handle that value, so on your system it wraps around and you find yourself with a negative value. | |
Re: [QUOTE=heroares;1699778]how can i write .[/QUOTE] The problem you've described is adequate as either the first or second program after hello world for absolute beginners, so if you don't know where to start, I'd say start by learning a little C++. | |
![]() | Re: [B]>I can't find good source of knowledge about this algorithm.[/B] Unless by "good" you mean "full source code that I can understand at my newbie level and instructions on exactly how it works so that I can paste it into my homework and get away with it", I'd say you … |
Re: [QUOTE]So in the long run it will probably be better to read it into a vector[/QUOTE] When I give this as an interview problem, there's a caveat that the file may be very large. Whether I mention it after being asked about file sizes or by rejecting solutions similar to … | |
Re: Have you written a change making program? It's the same concept for converting to roman numerals: spit out the largest possible denomination until there's nothing left in the remaining total. Start with that so you're no overwhelmed. | |
Re: >Not a good way I can't really imagine a "good" way to answer this make-work question. Every possible solution is ridiculous and impractical compared to just using the addition operator. :icon_rolleyes: | |
Re: [B]>How to avoid this?[/B] Let's start by asking why you want to do it. I can think of a few reasons to obfuscate the executable, and for the most part those reasons are either paranoid and ineffective, or easily avoided with proper design. | |
Re: Break it down into manageable parts. I'd say start by reading the file character by character and simply writing those characters to cout. | |
Re: Stupid questions teaching useless trivia with horrible code examples. I'd appreciate if you didn't propagate the rampant stereotypes of Indian programmers while at the same time leading everyone else astray. :icon_rolleyes: | |
Re: [QUOTE]im not looking for those boring library management,hotel management and stuff but something interseting which will force me to think.[/QUOTE] I think you'll find much of the "boring" stuff will indeed force you to think if you do it properly. Any idiot can write an amateurish project without thinking. Writing … | |
Re: The interface is better than Facebook (not a difficult feat), but my prediction is that Google+ will fail miserably since Facebook has already hit critical mass and will be extremely hard to compete with. | |
![]() | Re: >Is there a workaround? Switch to Code::Blocks. The underlying compiler is the same (gcc with MinGW), and the IDE is vastly superior in my opinion. Also, Dev-C++ is no longer under development and Code::Blocks is being actively worked on. >Is aesthetics important? The answer is subjective. I think aesthetics are … |
Re: >What are the answers for you questions? This thread isn't about answers, it's about providing questions for you to answer on your own. If you're having trouble, start your own thread to get help. | |
Re: I'm not sure I understand what you want to do, but even more so I don't understand why you want to do it. Can you be more specific? I'm guessing you're trying to solve a non-issue. | |
Just for fun, I wrote up a quick tutorial for basic assembly. At present, it's only in the form of a PDF document, but I'll eventually get around to adding it to my website. | |
Re: You can switch the console text color at will quite easily. Just change it to the desired color before printing the character, then change it back after printing the character: [code] #include <iostream> #include <windows.h> class TextAttr { friend std::ostream& operator<<(std::ostream& out, TextAttr attr) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), attr.value); return out; } … | |
Re: When mounting the drive, it's either implicitly or explicitly given a mount point. You use that mount point as the path (it's just a directory). For example using sda1 as the default mount point: [code] file = fopen("/dev/sda1/file.txt", "a+"); [/code] Though it would be a good idea to support a … | |
Re: C Unleashed by Richard Heathfield and friends should cover most of what you need. | |
Re: [QUOTE]my question is, why i got some error..I cant recognize such of that error...[/QUOTE] What's the error? :icon_rolleyes: | |
Re: [QUOTE]By the way, the book I was using was published in 2008, so how come it has so old instructions???[/QUOTE] What book is it? Most likely it's on the "not recommended" list. | |
Re: My first question would be, what's wrong with [url=http://www.realvnc.com/]this[/url]? | |
Re: It's an ordered list, so all you need to do is break off the search when the node's value is not less than the new item. To test for a duplicate, check and see if the next node has the same value as the new item: [code] // Empty list … | |
Re: [QUOTE]Variation in such a big range..[/QUOTE] Variation is expected. A better test would take the mean and standard deviation of multiple runs. [QUOTE]Is the time outputting in nanosecond..???[/QUOTE] The result is clock ticks, for whatever your implementation decides that to be. While still non-portable, a better method is like so: … | |
Re: >My friend and i were having a discussion the other day and we were >having a heated argument about how to make that dang diamond >pattern in C++ code A heated discussion, huh? Why not just write the damn thing and be done with it? There's not exactly anything to … |
The End.