1,265 Posted Topics

Member Avatar for srishekh

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

Member Avatar for WaltP
0
599
Member Avatar for Nikhar

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

Member Avatar for siddhant3s
0
336
Member Avatar for Punkis448

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 …

Member Avatar for siddhant3s
-1
935
Member Avatar for patrick k

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for yila

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]

Member Avatar for yila
0
790
Member Avatar for book_worm

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

Member Avatar for kangarooblood
0
365
Member Avatar for razsadeq

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

Member Avatar for razsadeq
0
2K
Member Avatar for mysong

perhaps you can try something like this. [code]if (critera) { // do whatever } else { // do something different }[/code]

Member Avatar for Salem
0
2K
Member Avatar for JugglerDrummer
Member Avatar for MidiMagic
0
241
Member Avatar for fghdmhmmd
Re: SLR

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

Member Avatar for jephthah
0
221
Member Avatar for edenn1

why do you need a helper function? seems that all the work is being done there anyhow.

Member Avatar for WaltP
0
105
Member Avatar for jephthah

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 …

Member Avatar for scru
1
177
Member Avatar for jephthah
Member Avatar for csurfer

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 …

Member Avatar for GrimJack
0
332
Member Avatar for MrNoob

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 …

Member Avatar for Tom Gunn
0
378
Member Avatar for ADCgal
Member Avatar for seemant_sun
Re: Help

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

Member Avatar for jephthah
1
116
Member Avatar for matt4615

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 …

Member Avatar for VernonDozier
0
846
Member Avatar for andy126

andy is damned and determined to pound those square pegs into some round holes. bummer. i was looking forward to some cool Narue code. .

Member Avatar for jephthah
0
163
Member Avatar for Engineer.Saleh

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 …

Member Avatar for Jupiter 2
0
1K
Member Avatar for peter_budo
Member Avatar for Nick Evan
0
160
Member Avatar for dudebag

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

Member Avatar for Narue
0
156
Member Avatar for lasher511
Member Avatar for thebluestar

i had that happen a lot. (1) get stuck (2) post question to forum (3) find and fix problem while waiting for answer :)

Member Avatar for jephthah
0
106
Member Avatar for MrNoob

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

Member Avatar for jephthah
0
114
Member Avatar for tiger86

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

Member Avatar for tiger86
0
165
Member Avatar for themaster

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

Member Avatar for Ancient Dragon
0
293
Member Avatar for vikasnahar

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

Member Avatar for seemant_sun
-1
107
Member Avatar for seemant_sun

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 …

Member Avatar for seemant_sun
0
484
Member Avatar for animefun2
Member Avatar for gnobber

i, too, believed the same thing Tux did.... thanks Narue for the detailed lesson. i learn a lot here. .

Member Avatar for DonB
0
327
Member Avatar for atman

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

Member Avatar for siddhant3s
0
123
Member Avatar for jimb90

"acne treatment for geeks"? well, that has to be the most randomly bizarre link i have ever seen in someone's signature. .

Member Avatar for Tulsa
0
316
Member Avatar for seemant_sun

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

Member Avatar for Ancient Dragon
0
120
Member Avatar for seemant_sun

curious, did you incrementally compile 1 additional indirection operator each time? did you use a scripting language to do it?

Member Avatar for Ancient Dragon
0
137
Member Avatar for gretty

i read this as "rock paper scissor string" problem. and thought the problem is, that "string" doesnt fit the "rock paper scissors" paradigm. :cool:

Member Avatar for jephthah
0
703
Member Avatar for serkan sendur

how about actually doing work when you're at work getting paid to work instead of goofing off?

Member Avatar for serkan sendur
0
106
Member Avatar for GrimJack
Member Avatar for rabbitwat2
Member Avatar for ithelp
Member Avatar for vegaseat
0
143
Member Avatar for ithelp

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 …

Member Avatar for vegaseat
0
164
Member Avatar for AnujSuper9

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

Member Avatar for jephthah
0
6K
Member Avatar for Ancient Dragon

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 …

Member Avatar for ahihihi...
0
92
Member Avatar for lukethedrifter

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

Member Avatar for Ancient Dragon
0
226
Member Avatar for nagu89

(1) don't use conio.h (2) do post your questions in the appropriate forum: this is C++ code, not C

Member Avatar for ArkM
0
121
Member Avatar for 0xCMD

^^^ 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. :) .

Member Avatar for csurfer
0
171
Member Avatar for Traicey
Member Avatar for red999
Member Avatar for JJS
0
80
Member Avatar for meshari

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

Member Avatar for Salem
0
112
Member Avatar for luvnbigd1111

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.

Member Avatar for aditya2071990
0
144

The End.