1,265 Posted Topics
Re: [QUOTE]can u give me da code in "c" [/QUOTE] if you weren't purposely talking like a braindead AOL chatroom luser, i might actually "give u da code". | |
Re: i assume you want to *print* a large float or double value in scientific notation. [code] double myLargeNum; ... printf("value = %.2e\n",myLargeNum); [/code] [url]http://www.cplusplus.com/reference/clibrary/cstdio/printf.html[/url] . | |
Re: [URL="http://en.wikipedia.org/wiki/Dijkstra's_algorithm"]Dijkstra's Algorithm[/URL] [URL="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=12850&objectType=file"]MATLAB Code[/URL] . | |
Re: i just realized this thread was 2 years old oh well, whatever. here's a guy's webpage for making a beep in linux. [url]http://frank-buss.de/beep/index.html[/url] i have no idea if it works. | |
Re: you might try format precision specifiers if you want to reduce the number of decimal places. for instance, [B]"%.2f"[/B] will round it to two decimal places, dropping any trailing zeros in the fractional part. [code]1234.56 24.68 0.9[/code] even better, [B]"%8.03f"[/B] will round it to three decimal places, keep any trailing … | |
Re: you want the source code for the standard C library? ok, here it is: [url]http://ftp.gnu.org/gnu/glibc/glibc-2.7.tar.gz[/url] now please do feel free to go and knock yourself out. and if you can manage a specific, coherent, targeted question, I'm sure someone will try to help you. but please don't feel free to … | |
so... whatchyallthink? i notice that this forum gets a tiny burst of activity about once a week. before posting this thread, the last couple posts here were made 9 days ago. then the next few were 17 days ago. and this pattern seems to be the same with other multi-language … | |
Re: i would never use malloc() where longterm runtime stability is critical. that said, i don't understand how you can so easily rule out a memory leak. yes, i hear what you're saying about how your available memory [I]appears[/I] to be ~1GB... but to use that sort of indirect observation to … | |
Re: why are you even using the type [b]long[/b]? you know that long is an integer, right? what you are doing here is taking the [b]double[/b] floating point value [inlinecode](antal_minutter * minuttakst * 10000.0 + 0.5 )[/inlinecode], converting it into a [b]long int[/b] which drops any fractional part, then converting it … | |
Re: you just posted this problem yesterday, and I answered it. [url]http://www.daniweb.com/forums/thread125124.html[/url] if the answer is not sufficient, please continue to address your questions in your original post. Please don't clutter up the forums with multiple threads on the same problem. . | |
Re: are you just trying to delete the numeral characters from a string? then do something like this [code=c] void deleteNumerals(char *mystring) { char *str_ptr = mystring; while(*str_ptr) { if (*str_ptr<'0' || *str_ptr>'9') *mystring++ = *str_ptr; str_ptr++; } *mystring = '\0'; } [/code] just note that the string being pointed to … | |
Re: source code is not "kind of like a programming code"... source code [B]IS[/B] the programming code. it's the entire .c file and everything in it that you wrote. so if you want to describe it, then just write -- in plain words and simple sentences -- what your code actaully … | |
![]() | Re: CodeBlocks is an IDE that can be used with most any compiler. But it is not a compiler, itself. its just a shell. so you need to use CodeBlocks in conjunction with a compiler, and preferrably one that, unlike Turbo C, is tightly bound to the ANSI standard. I think … |
Re: so... what's your question now? i tried compiling your original file from post #1 and i got about 100 errors. | |
Re: too bad most people on here don't have membership to ACM. | |
Re: "help a little more" how can we help you if you dont give us any thing to work with. you cant plop down the description of a problem, and say "help me fix my program to work better" and then not even show us WTF you've been doing? post your … | |
Re: nick's first suggestion is good for a single character, but you'd have to write a function to convert an entire string. something like: [code=c]void changeBufferToUpper (char *buffer) { char * buffer_ptr = buffer; size_t buffer_len = strlen(buffer); while(buffer_len--) buffer_ptr=toupper(buffer_ptr++); }[/code] as for nick's second suggestion, [icode]buffer += '0'; /* add … | |
Re: everything is urgent, it seems. people need to start posting their questions with subject headings like: "Help Help!! Life or Death Problem Here!!!" or maybe "OMG MY ASS IS ON FIRE AND MY HEAD IS A-CATCHIN', SUMBODY PLS ANSWER MY Q!!!" otherwise, im gonna get bogged down trying to answer … | |
Re: it worked in Turbo C, because Turbo C is riddled with undefined behavior and non-ANSI libraries in standard distribution. It's the AOL of C compilers. In other words, it's a joke. Do yourself a huge favor and quit using it. anyhow.... if you're intent on keeping "header" declared as pointer, … | |
Re: well, i think im pretty stupid. i spent damn near a half hour, first taking the test, then cycling through about 50 freakin adverts to get the results without giving any info, or giving false info. i finally quit and didnt get anything :grr: but my consolation is that im … | |
Re: first off, start indenting your code blocks. you're setting yourself up for failure if you cant easily differentiate where nested conditional blocks start and stop. it's also annoying as hell to try and read someone else's code who doesn't indent. [code=c] void add() { clrscr(); int item_code = 0; char … | |
Re: You know, I was going to help you, because this is an easy problem... But then i get here and see not a single code block or conditional statement is indented. I mean, look at your code, look at all those opening and closing braces lined up like little tiny … | |
Re: HAY GUISE there's a CHICK with a NICE PUSSY THIS HAS NEVER BEEN DONE BEFORE HA HA, I'M ON TEH INTERWEBS!!!!1 | |
Re: um, trying to exploit Google page rankings is a significant problem even for experts.. as a "beginner", you'll be better served trying to program a Sudoku game or something... but, if you're really intent on trying to hack some websites, most SkriptKiddi3Z prefer Perl for this sort of task... . | |
Re: this is a job for regular expressions. try using the Regex++ library for C++ [url]http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm[/url] | |
Re: here's your problem... [code] if (rooms[i]==NULL ) { rooms[i] = &p; callDoctor(tree,i); [b][COLOR="Red"]i = 5;[/COLOR][/b] } [/code] you just set index i=5... your array only has 5 elements, 0-4. so when you try to access room[5], it craps out on you. . | |
Re: yeah ... i'm just not seeing where the "Urgency" is here i thought someone was bleeding on the floor. | |
Re: FOR or WHILE as in, [code=c]for (count=1; count<= MAX; count++) { <stuff> } ... while(count <= MAX) { <stuff> } [/code] the FOR loop will perform <stuff> MAX number of times before continuing with the rest of the program. note that the variable "count" is incremented once each time the … | |
Re: good thing about shotguns is that if you're close enough you can still hit the target even if your aim is lousy. | |
Re: >> 4. What will be printed if the user enters “Wingding”? well .. what happened?? if you used scanf, i'll bet it went to crap real quick. which would not be an example of "robustness". >> 7. Give a set of values that will test the normal operation of this … | |
Re: [code=c] #include <stdio.h> #include <time.h> int main () { time_t unixTime; FILE * fp; char stamp[32]; unixTime = time (NULL); fprintf (stamp,"timestamp: %ld\n", unixTime); if (fp = fopen("myfile.txt","a")) { fputs(stamp,fp); fclose(fp); } return 0; }[/code] f you want to know what "unix time" is and how you can make it … | |
Re: thats one of the most godawful implementations of a stack ive ever seen. a stack is supposed to be simple: PUSH and POP. that's it. . | |
Re: i learned assembly years ago as my first language (not counting BASIC, Pascal and Fortran, which i never did anything meaningful with)... in the early 90's it was important to know Assembly to do embedded programming, because the C compilers for embedded controllers were terribly inefficient -- and expensive if … | |
Re: i tried this once but it was lacking in immediate gratification. i think my nation eventually depleted their resources and turned to cannibalism, but i'm not for sure | |
... this whole reputation points and altering power business works... ive got like 70-some-odd points, but i still only have one little green box, and 1 altering point. I'd sure feel cool if i could get a few more green things ... it'd also be nice to know what the … | |
| |
![]() | Re: lol. dont start with Salem about void main. not only is it his [I]raison d'être[/I] ... but he's right . ![]() |
Re: by just using the "e" format, you'll get standard scientific exponentiation, but it might not be exactly what you're looking for for instance if you specify 2 decimal places like so: [icode]printf("%.2e",myDoubleValue);[/icode] your example values will be printed as [icode]1.20e-5[/icode] and [icode]1.31e13[/icode] it will not force them along standard "engineering … | |
Re: yeah fun stuff, but you'd better not be initiating those pranks from inside the U.S. the FCC has started prosecuting people who send phone pranks from the Internet under a provision of the Wagner-Folsom Act of 1977, the so-called "Anti-War Dialing Act". [url]http://tinyurl.com/2g9mqh[/url] . | |
Re: lol. i love these threads, only because it tends to be my own M.O.: post a question for help, then while waiting for responses to trickle in, go about trying to solve it myself anyhow. sometimes just formulating the question reveals the answer. :) | |
Re: what did you expect it to do? you're trying to do the close and tell function on a NULL pointer. now think about that for a minute, and you should have your answer. . | |
Re: i can compile it and run it through some tests, if that's what you're looking for? | |
Re: i think this is an example of "obfuscated code" perl programmers also love to do stuff like this. | |
Re: char myCharacter = 'A'; printf("%c = %d",myCharacter,myCharacter); | |
Re: well, for one thing: [code] size_t i=0; /*counter for loop*/ int len; /*length of line from file*/ [/code] you've got your types switched. not really going to make a difference (size_t is typically #defined as a long int) but still... if this basic stuff is wrong, i wonder how much … | |
Re: if "strtok( )" is not already a good friend of yours, you should become acquainted soon :P |
The End.