1,265 Posted Topics

Member Avatar for rcbhat

[QUOTE=rcbhat;915302]So, correct me if you think I may be wrong, but your reply is out of context for the question.[/QUOTE] it's correct, and totally within context. because your original question and code made it appear that you were operating on a misconception about string literals. even if you did not …

Member Avatar for tuse
0
291
Member Avatar for tangent03
Member Avatar for Tom Gunn
0
145
Member Avatar for makavelixx

your last few lines, where you're presumably calculating and printing the "fuel required" doesnt make any sense. youre supposed to [B]calculate[/B] the fuel required, not prompt the user to enter the fuel required. fuel required is calculated by "total miles / miles per gallon" ... you can print it like …

Member Avatar for Pavan_
0
278
Member Avatar for rachelwiliam

who knows? and more importanly, who cares? the OP didn't bother describing anything, so i'm not going to bother trying cipher out the code. Or trying to read his mind. the fact that he uses <conio.h> does tells me it's probably a broken, unportable mess, and I just stopped looking …

Member Avatar for tux4life
0
141
Member Avatar for mshafi

[QUOTE=adatapost;913951]your compiler is 17 years old. Now, it's time to say good bye to that compiler.[/URL][/QUOTE] well said.

Member Avatar for dng
0
450
Member Avatar for xyzt
Member Avatar for jqbsx
1
68
Member Avatar for jephthah

Lieutanant Dan! Hello, Forrest. You got new legs. New legs! Yeah, I got new legs. Custom-made titanium ... what they use on the space shuttle. Magic legs!

Member Avatar for Godsp3ed
1
124
Member Avatar for jessejamesjjr

[QUOTE=jessejamesjjr;912915]any other suggestions?????[/QUOTE] um, stop looking at porn at work?

Member Avatar for Salem
0
135
Member Avatar for chrishtones

i belive what you are looking to use are the [URL="http://www.cplusplus.com/reference/clibrary/cmath/acos/"]acos()[/URL], [URL="http://www.cplusplus.com/reference/clibrary/cmath/asin/"]asin()[/URL], and [URL="http://www.cplusplus.com/reference/clibrary/cmath/atan/"]atan()[/URL] functions. for instance: [URL="http://www.cplusplus.com/reference/clibrary/cmath/tan/"]tan()[/URL] returns the ratio of the sides (y/x or opposite/adjacent) when given the angle in radians as the argument .... whereas [URL="http://www.cplusplus.com/reference/clibrary/cmath/atan/"]atan()[/URL] returns the angle in radians, when given the ratio of the …

Member Avatar for tux4life
-1
184
Member Avatar for nonadoes

[QUOTE=nonadoes;911676]how to extract some character/number from a char string? Example: char = TAGNAME_C123_V45_S67_M89 [/QUOTE] what you have written here is an identifier from a [icode]#define[/icode]'d constant -- not a string. if it [I]were[/I] a string, then you could use sscanf() as Tom Gunn suggested. but he's assumed that you really …

Member Avatar for nonadoes
0
220
Member Avatar for melissa.johns

[QUOTE]I have about a year to finish the program, under a grant to teach non computer literate majors (me) how to program.[/QUOTE] well, you're gonna learn alot. it won't be efficient learning, and you'll probably learn a lot of poor practices, just to "get the job done". and you're probably …

Member Avatar for jephthah
0
101
Member Avatar for GDICommander

yeah, i was going to say about the same thing.... because obviously there must have been more of a change than merely replacing malloc() with calloc(), since the two are functionally identical aside from initializing memory with zeroes. .

Member Avatar for jephthah
0
302
Member Avatar for OffbeatPatriot

[QUOTE]kernel32.lib can't be found. I've found the library in some Microsoft SDK folder and I add that to the library search path but ... something is wrong.[/QUOTE] your .NET installation is broken. Unless you're some sort of windows/.NET guru, the chance of you fixing it correctly is small. uninstall all …

Member Avatar for OffbeatPatriot
0
592
Member Avatar for monkey_king

[QUOTE=BestJewSinceJC;911909]Why would you give me bad reputation[/quote] [I][B]"i dont know but here's google"[/B][/I] may be appropriate in some cases, but Monkey_King posted a decent question, included formatted code, described the output he wanted, and asked why wasnt it working exactly the way he anticipated. And the answer is not so …

Member Avatar for jephthah
0
3K
Member Avatar for MosaicFuneral
Member Avatar for Menster

this is a bizarre correlation that you've made, that most programmers are "stoners". i don't really know many programmers who are "stoners". most of them are intellectual types (or even downright "nerds") who aren't especially prone to partying. granted *some* of them can be grouped in what you would classify …

Member Avatar for Menster
0
142
Member Avatar for Ancient Dragon
Member Avatar for jbennet
0
75
Member Avatar for grisos
Member Avatar for Salem

[QUOTE]For those with a below-par grin ...smile-boosting messages will pop up on the computer screen [such as] "lift up your mouth corners",[/QUOTE] umm... yeah. You know what? [url="http://www.weirdasianews.com/wp-content/uploads/2008/06/no-further-description.jpg"] Japan [/url][URL="http://andre.stechert.org/weird_japanese_shit/only_in_japan.jpg"] is kind of [/URL][URL="http://inquisitr.com/extra/wp-content/2008/12/japan2.jpg"] weird.[/URL]

Member Avatar for MosaicFuneral
0
176
Member Avatar for 9868

if you define the function [I]after [/I]it is called by the code -- such as in "main()" -- the compiler needs a prototype to know how to handle the function when it runs across it in the code. otherwise, it has no clue what the function is and whether or …

Member Avatar for jephthah
0
291
Member Avatar for Pavan_

[QUOTE=Pavan_;909756]After adding malloc ,this code compile and execute perfectly ... can u explain it?[/QUOTE] 'k' is a pointer. meaning it describes, or "points to," an address of memory. when you first declare this pointer, there is no memory allocated for it and the address that it points to is undefined. …

Member Avatar for tux4life
0
245
Member Avatar for Flyin dagger
Member Avatar for macdonpr

I Third the vote for [URL="http://www.codeblocks.org/"]Code::Blocks[/URL] get [URL="http://www.codeblocks.org/downloads/5"]the version "codeblocks-8.02mingw-setup.exe"[/URL], it comes with the MinGW (gcc) compiler, and you cant go wrong. it's an industry standard. I would not recommend that you use a text editor and stand-alone compiler to learn.... that will increase your frustration. i used to program …

Member Avatar for rampurhaat
0
184
Member Avatar for MrNoob

fflush(stdin) is totally, utterly, and completely wrong. never, ever, use it. learn to parse your input correctly in the first place, and you wont have this problem. so get rid of scanf() while you're at it. that's a bad function to use, and is a source of the problem. use …

Member Avatar for MrNoob
0
152
Member Avatar for Narue
Member Avatar for monkey_king

[QUOTE]Does anyone have an idea if this can be done smarter, better, faster?[/QUOTE] check out: [URL="http://www.cplusplus.com/reference/clibrary/cstring/strtok/"]strtok()[/URL] ... this breaks a string into tokens at each of one or more delimiters. use it to break the string at each '+' or '-' (the delimiters), then check if the first one or …

Member Avatar for Yrth
0
151
Member Avatar for mgoswami

[QUOTE=mgoswami;906911]Hi, I am interested in doing Phd in computer science. Can anyone help me in finding a suitable topic waiting for early reply.[/QUOTE] here's an early reply: get your PhD in post-hole digging. i mean, jesus. if you need an internet chat forum to tell you what your career research …

Member Avatar for jephthah
1
197
Member Avatar for mrayoub

mrayoub: %i and %d are equivalent. both of them specify the format for a signed [B][COLOR="Red"]d[/COLOR][/B]ecimal [B][COLOR="Red"]i[/COLOR][/B]nteger, and either are acceptable to use. %u, as you have seen, is for [B][COLOR="Red"]u[/COLOR][/B]nsigned decimal integer however, if you have declared a variable of type [icode]int[/icode] then you should not print it as …

Member Avatar for ajay.krish123
0
167
Member Avatar for azjherben

[QUOTE=azjherben;906995]If you could just tell me how to set a socket to non blocking and explain select() to me I'd be grateful.[/QUOTE] [url]http://tangentsoft.net/wskfaq/examples/basics/select-server.html[/url]

Member Avatar for Nick Evan
0
188
Member Avatar for tyserman5674

the answer to your basic problem: [code=c]if isdigit(cResponse);[/code] is incorrect. it should be [code=c]if (isdigit(cResponse)) { // do stuff here } [/code] (1) an if-statement must be entirely enclosed in parentheses. (2) an if-statement -- if the condition is evaluated as true -- will execute [B]either [/B]one line of code …

Member Avatar for tyserman5674
0
145
Member Avatar for _dragonwolf_

i find it pretty incredible that a professor would dump all this at once to beginners who had never passed arguments to functions before

Member Avatar for jephthah
0
123
Member Avatar for MosaicFuneral

i just recently made the switch from creamy to chunky. sometimes extra chunky. it's like, "where have you been all my life?"

Member Avatar for jephthah
0
392
Member Avatar for Whilliam

most of these trifling problems will go away when you throw away the P.O.S. Borland/Turbo compiler and get a real C/C++ compiler like [URL="http://www.codeblocks.org"]CodeBlocks[/URL] or [URL="http://www.bloodshed.net/dev/devcpp.html"]Bloodshed Dev C++[/URL]. these GCC-based, standard C compilers wont let you use worthless functions like flushall(), obsolete libraries like conio.h, and will complain heartily if …

Member Avatar for csurfer
0
218
Member Avatar for digital-ether

looks like you're on a Linux platform, yes? so you should have the Gnu C Compiler (gcc) available. put the files you want to compile in one directory, and invoke the GCC compiler like so [code]gcc -o <binaryName> <source1.c> <source2.c> <...>[/code] where binaryName is an arbitrary name of the compiled …

Member Avatar for jephthah
0
171
Member Avatar for DoEds
Member Avatar for Tom Gunn
0
359
Member Avatar for kostasxx

some compilers will initialize variables to zero. but there is no requirement in the C "rules" for them to do so. therefore, most compilers will [B]not [/B]initialize variables you declare, and so their contents are undefined until you do so. they will contain whatever bit pattern previously existed at whatever …

Member Avatar for kostasxx
0
93
Member Avatar for amrith92

there's a lot of evidence supporting "near death experiences"... that sort of parallels the concept of ghosts. i dont believe in anything supernatural, personally, but i also don't presume to have definitive answers for things that can't be demonstrated or explained. some people truly believe they have had experiences that …

Member Avatar for jephthah
1
347
Member Avatar for Meldroz

well, that sure was a helluva lot of effort you put into "solving" someone's 5-year-old homework problem. it almost pains me to tell you that it's completely broken and won't compile on any standard C compiler. :( int main(void) { // in the future, code tags would also be nice …

Member Avatar for jephthah
0
332
Member Avatar for xgmx

an intellectual is just someone whose education level exceeds their abilities.

Member Avatar for s_sridhar
-1
418
Member Avatar for ndeniche
Member Avatar for crash1989

the formula posted by siddhant is fundamentally flawed. it only appeared to work, because it just happened to be valid for n=2 through n=8. as 'n' increases past 8, the result becomes more and more inaccurate. n=9 to n=11, the result is off by 1 n=12 to n=14, the result …

Member Avatar for crash1989
0
642
Member Avatar for xyzt

[QUOTE=Tom Gunn;897794]you don't have to initialize every member before the one you want to initialize. 0 is the default, so if I wanted to only initialize third, the old way is still the same but the new way is easier...[/QUOTE] Wrong. Wrong. Wrong. Structures, or any other variable, are [B]not …

Member Avatar for tux4life
0
131
Member Avatar for XTRobot

[QUOTE]Hi,first i must say this is not my homework,because i am to young (14 Years old)to have programming homework.[/QUOTE] that's ridiculous. 14 y.o. is High School, and you are certainly old enough to have homework in a programming class. furthermore this is a typical standard homework problem. i'm not saying …

Member Avatar for Stefano Mtangoo
0
242
Member Avatar for mamabile
Member Avatar for mamabile
-1
59
Member Avatar for dombit

[QUOTE]Statistics on barking dogs[/QUOTE] good lord, that's funny. but i don't think the OP is interested in buying a commercial product to submit as a school project or whatever he's trying to do this for. a Do-It-Yourself project, i think you will need a sensor to detect sound (a microphone), …

Member Avatar for MosaicFuneral
0
144
Member Avatar for scru
Member Avatar for jbennet
0
333
Member Avatar for The Dude
Member Avatar for ganesh_bala

EDIT: never mind. [URL="http://lmgtfy.com/?q=mulitple+precision+library"]find it yourself.[/URL]

Member Avatar for Hiroshe
0
142
Member Avatar for RoninMastaFX

^ what he's saying is that you should *never* use the "equal to" comparison operator for floating point variables. while his vocabulary wasn't precise about the type of comparison operator, he's correct that you should never use the "equal to" comparison operator to compare floating points. instead use the greater …

Member Avatar for jephthah
0
135
Member Avatar for tux4life

The End.