1,265 Posted Topics
Re: [QUOTE=perseus31;898368]i don't think you can use the concept of 200 pages to measure time accurately.[/QUOTE] but you can wait 3 1/2 years to respond to a thread and divide that time by the number of total posts, for a rough estimate of the number of thread-posts per year. amirite? | |
Re: [QUOTE]The problem is the way we are taught in school. In school, we still use #include<iostream.h>,#include<conio.h>,getch(),clrscsr()...etc.etc....[/QUOTE] I say that you should avoid the use of old, non-standard libraries like "conio.h" unless you are explicitly instructed -- required -- to do so. anyone can quickly learn to use any library function … | |
Re: i notice your function is called: "ha[B][COLOR="Red"]n[/COLOR][/B]ming" ...but i imagine you would easily figure out a compile time error such as that. otherwise, i dont really have fooking clue as to what "calculating [URL="http://en.wikipedia.org/wiki/Entropy_(Information_theory)"]entropy[/URL] of a file and coding it using [URL="http://en.wikipedia.org/wiki/Hamming_code"]hamming[/URL]" means. To be honest, I was thinking of … | |
Re: here's one problem that immediately jumps out: [code=c]leapyr (year); if (leap == 1)[/code] you need to assign the variable leap to the return value of the function [code=c]leap = leapyr(year)[/code] but, more importantly, you should really consider using the standard C library <[URL="http://www.cplusplus.com/reference/clibrary/ctime/"]time.h[/URL]> pay attention to the time_t and tm … | |
Re: what salem said. and, anyhow, if you really want to do this correctly, you will use the standard C library [URL="http://www.cplusplus.com/reference/clibrary/ctime/"]<time.h>[/URL] ... you will make use of the time_t type, and the structure tm. [URL="http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.15.html"] here is a tutorial[/URL] | |
Re: [QUOTE=book_worm;895053]Hello World! i want to write a program[/quote] awesome! [quote]Can any one help me!?[/quote] sure can! [quote]Thanks in advance![/QUOTE] you're welcome! . | |
Re: as already stated, never try to use strings as cases for a switch. Some languages (like Perl) will allow this. C will not. you could, for instance, try something like this: [code=c]void read_snum(char *sno) { int courseNum; courseNum = atol(sno); switch(courseNum) { case 1: printf("\n%s\n", 'one'); break; case 2: printf("\n%s\n", … | |
Re: perhaps you can try something like this. [code]if (critera) { // do whatever } else { // do something different }[/code] | |
Re: or if you use FF and ABP, you dont ever have to worry about any site ads, anywhere, ever. | |
Re: [QUOTE=fghdmhmmd;895365]no,this is a C language program,i test it,this code is run,but don't work correctly,i don't know why work incorrectly!confused[/QUOTE] no, this is C++. Not C. Which is probably a lot of your problem: you're confusing two related, but different, languages. [QUOTE=fghdmhmmd;895364]please help me ? where i give my answer ? … | |
Re: why do you need a helper function? seems that all the work is being done there anyhow. | |
Dear little Greek letter Omega, how do I love thee? Let me count the ways. Your smooth lines and the parallel symmetry of your gently swelling curvatures, descending in a pendulous manner before convexly arising to cleave together at your magnificent center. Damn the font size 12! You shall always … | |
Re: there's no such thing as a truly random number. all random number generators are pseudo-random. the difference is that some generators are better than others, in that their sequences are harder to predict than others, given current computing technology. in other words, we have number generators that are, for all … | |
Re: take the example: given x=0x55 (dec 85, binary 01010101), p=6, n=5, and y=0xEE (dec 238, binary 11101110) what you want to happen is this: [code] x= 01010101 (0x55, dec 85) p=6 ^ (bit #6) n=5 ..... (get 5 bits) -10101-- (extracted from 'x'. '-' are zeros) y= 11101110 (0xEE, dec … | |
Re: "thorough knowledge"? but little practical experience?? LOL :) sorry bud, you don't have a thorough knowledge of C, until you gain [B] lots[/B] of experience. i've been programming C for years and the more i program the more i realize i don't know. in fact, i really don't know a … | |
Re: think about the typical Lotto game, and how the numbers are selected: you have 40 balls rolling around in a container from which 6 are picked, one at a time, at random. after each successive pick, the pool of available numbers able to be selected is reduced in size by … | |
Re: andy is damned and determined to pound those square pegs into some round holes. bummer. i was looking forward to some cool Narue code. . | |
Re: Yes. You can... "Engineer Saleh" So, I can't help but notice you have vaingloriously put the professional title "engineer" in your name I wonder, have you earned that right by passing a core competency professional exam or working for several years as a professional in the field? if so, you'll … | |
Re: doh! (i won't admit that i just tried to click the link, myself) | |
Re: [QUOTE=dudebag;890955]You must submit [i]two[/i] valid Bot programs (one for your Offense Bot & one for your Defense Bot) to me at [email]_my_email_@gmail.com[/email][/QUOTE] yeah, i'm thinking this must be some sort of trap. . | |
Re: i had that happen a lot. (1) get stuck (2) post question to forum (3) find and fix problem while waiting for answer :) | |
Re: [icode]~(~0 << n)[/icode] makes a bitmask of ones equal to the number 'n'. does this by first filling the integer full of ones, then shifting them to the left 'n' bits (filling lsb's with zeros), then inverts all the bits. for instance, n=5 makes a bitmask = '...00000011111' [icode]x >> … | |
Re: [QUOTE]I am well aware of Netscape going open source which ended the company.[/QUOTE] Then you're not well aware of anything regarding this issue. Netscape Navigator was a proprietary browser that was licensed to personal users for free. Internet Explorer soon dominated the market due to a number of factors, including … | |
Re: [quote]I cannot ____ because I use Turbo C++ 3.0 IDE[/quote] are you stuck in a time machine? or is it still 1990, where you live? throw that shit out, and join the 21st Century [quote]If possible could you please give an example. [/QUOTE] [URL="http://www.codeblocks.org/"]Code::Blocks[/URL] (free) [URL="http://www.microsoft.com/Express/vc/"]Visual C++ express[/URL] (free) [URL="http://www.bloodshed.net/devcpp.html"]Bloodshed … | |
Re: [QUOTE=csurfer;887635]nothing more could be added.[/QUOTE] well... he [I]could [/I]rewrite the entire code with full comments, perform validation and coverage metrics, compile release executables and build distribution kits for several major operating systems, then upload the packages to SourceForge and other repositories. or he could just continue spitting out redundantly obvious … | |
Re: the answer to this question is not straightforward at all. fgets will return [I]everything[/I] up to and including the newline. But the problem is, that a newline character's ASCII representation is system dependent. on *nix environments, the newline character ('\n') is typically represented as a single byte, the <LF> or … | |
| |
Re: i, too, believed the same thing Tux did.... thanks Narue for the detailed lesson. i learn a lot here. . | |
Re: short answer: static arrays are allocated when the function is called, at which point your variable is undefined. so the construct is illegal. if you want to dynamically allocate arrays, you need to use malloc() along with a corresponding free() | |
Re: "acne treatment for geeks"? well, that has to be the most randomly bizarre link i have ever seen in someone's signature. . | |
Re: are you using *nix? [code=c]#include <stdio.h> #include <sys/stat.h> int getFileSize(char *filename, long *filesize) { struct stat filestats; if (stat(filename, &filestats) < 0) { { perror(filename); return 0; } else *filesize = filestats.st_size; printf(" The size of %s is %ld bytes (%3.1f KB)\n", filename, *filesize, (*filesize / 1024.0) ); return 1; … | |
Re: curious, did you incrementally compile 1 additional indirection operator each time? did you use a scripting language to do it? | |
Re: i read this as "rock paper scissor string" problem. and thought the problem is, that "string" doesnt fit the "rock paper scissors" paradigm. :cool: | |
Re: how about actually doing work when you're at work getting paid to work instead of goofing off? | |
Re: what would be the boiling point of a cup of water in empty space? | |
Re: my most abused key on this laptop is [b]F4[/b]. Dunno why, but it got all jammed up, and i had to rip the thing out. and i've since found that laptop keys are damn near impossible to replace. :( on my work keyboard, theres a layer of film/crud/mold/i-dont-know-what built up … | |
Re: when in doubt, start simple and work your way up. first get the mechanics of the board working. placing letters and calculating scores manually then try implementing a simple algorithm to calculate all possible words (and their correspondign scores) given a set of letters, at one "insertion point" ... meaning, … | |
Re: i dont think she made a fool of ol' whats-his-nuts. that guy's a jackass anyhow. but she did kind of turn people off at the beginning. however i'm sure it's because she's been made fun and marginalized, having to perform in low-class dives ... that's her defense mechanism to not … | |
Re: void main() flushall() lol() googling for a week? are you exaggerating? cause[URL="http://www.codeguru.com/forum/showthread.php?t=360665"] i just found it [/URL] in about 30 seconds. . | |
Re: (1) don't use conio.h (2) do post your questions in the appropriate forum: this is C++ code, not C | |
Re: ^^^ 16^2 is not 484. (!!) ^ the method to convert binary will only work on bases with a power of 2... Works for octal, hex, and base-64 (armored ascii)... won't work for decimal. but other than the details, your methods are correct. :) . | |
Re: yeah, about 12 'if / else if" conditional statements. | |
| |
Re: [QUOTE]if somebody can write the code for me that do these things[/QUOTE] ahahah. that's funny. oh wait.... you're serious aren't you? | |
Re: post your Q&A sheet right here. i expect you'll get a few responses from which you can pick and choose which one to use. |
The End.