2,384 Posted Topics
Re: Is anyone here else going to recreate all the code you've written as an initial attempt? *<stunned> silence* C'mon. That's not a question, that's asking someone to do 99% of thee work for you. | |
Re: If num < 4, how will it ever be equal to 4 for the switch? Might you have meant 0? | |
Re: I enjoyed [URL="http://www.intellectualconservative.com/2008/01/31/another-loony-theory-from-the-wonderland-of-evolution/"]this article[/URL] recently. | |
Re: [QUOTE=thunderstorm98;539210]I had Experience with Firefox 2, It uses lot of bandwidth in background until when no site is opened...Switch to version 3 (Beta 1) and choose yourself what to load or what not to under Options.[/QUOTE][memory jog]I was recently fixin' up some memory issues with one of my FF installs … | |
Re: Various subtleties, but 'EOF character' is not a good idiom to maintain. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048865140&id=1043284351[/url] | |
Re: I was wishing I'd gotten Gen 5 Archos. [url]http://www.daniweb.com/blogs/entry1726.html[/url] | |
Re: "Explanation" in the comments: [code=C++]#include <iostream> #include <ctime> int main() { /** * Fill a struct tm. */ struct tm date = {0}; date.tm_year = 108; // 2008 date.tm_mon = 1; // February date.tm_mday = 19; // 19 /** * Normalize it. */ time_t normal = std::mktime(&date); /** * Create … | |
Re: [QUOTE=sk8ndestroy14;508798](annoyance: people that correct others on every little thing).[/QUOTE]Shouldn't 'annoyance' be capitalized? And shouldn't the period be in the parentheses? :D | |
Re: You _ss! What happens in IRC stays in IRC! But those kicks/bans are silly. The one(s) it's designed to catch work around them in seconds anyway. | |
Re: [QUOTE=sneekula;507983]What forms of transportation would you consider in your situation to minimize energy consumption?[/QUOTE]Back local politicians who would propose extra lanes on the major throughways on which I drive my Chevy Silverado. | |
Re: Sounds like your install may be hosed or you have not yet set the include directories. | |
Re: I had it from the quick reply several times yesterday and again just now -- hadn't cleared temp files. But same behavior on 2 boxes. | |
| |
Re: [QUOTE=atish00;547913]nad what is ^Z thanx for the help so far.[/QUOTE][url]http://en.wikipedia.org/wiki/End-of-file[/url] [url]http://en.wikipedia.org/wiki/Control-Z[/url] | |
Re: If your current behavior is like a previous attempt, maybe it's because this latest code you posted doesn't compile. [code] int max = temp[0][COLOR="Red"],[/COLOR] int maxtempnum = 0; int min = temp[0][COLOR="Red"],[/COLOR] int mintempnum = 0; [/code] | |
Re: [QUOTE=mitrmkar;549982]Here is the version I used (and please go through the %d's and change to %lf where-ever you output a double using printf())[/QUOTE]Trivia: using [icode]%lf[/icode] with [icode]printf[/icode] is undefined behavior in C90, a common nonstandard extension, and standardized in the uncommonly-implemented C99 as ignoring the [icode]l[/icode]. | |
Re: [icode]'[COLOR="Red"]\[/COLOR]n'[/icode][code] if(code=='G')[COLOR="Red"]//;[/COLOR] ifs >> gas; // ???[/code][code] if ( gas_charge < gas_minimum )[COLOR="Red"]//;[/COLOR][/code] | |
Re: It is quite likely that your current code may do just that. | |
Re: [QUOTE=Ancient Dragon;548949]**p can be either 1) a pointer to a pointer, or [COLOR="Red"]2) a two dimensional array[/COLOR].[/QUOTE]I'm generally a bit leary about (2). I understand the implication that the meaning of [I]a two dimensional array[/I] here is perhaps [I]a simulated two dimensional array that has been dynamically allocated[/I] rather than … | |
Re: The issue with this sort of thing is that the problem is often not where it is detected. So looking at the place that it was detected my prove fruitless. There are some utilities that help detect memory abuses, but I cannot recommend any. What I have done instead is … | |
Re: The same newline issue is left after the input of the double. It then immediately satisfies the subsequent call to [icode]scanf[/icode] in which you type [icode]y[/icode]. | |
Re: [QUOTE=Ancient Dragon;547774]If that's the case, there are a couple ways to do it. One way is to use strcpy() function [code] char str[] = "SACRED"; strcpy( &str[2], &str[3]); [/code] I didn't compile or test that, but I think it will work.[/QUOTE]Undefined behavior. | |
Re: Allocate enough room for the string and if successful strcpy it. | |
Re: It almost sounds like you are trying to calculate the length of a string like [icode]strlen[/icode] does. | |
Re: You're lucky it doesn't compile so that you don't have an unconditional loop continually writing unknown garbage to a file. I'd say your first step here might be to have some text to write to the file. And given your loop, I'd say skip the looping for the moment too. … | |
| |
Re: Hmm. Probably the audio streaming transmitter interfaced to a PC with a custom USB interface. I got to bring in my old stereo and speakers for device testing! But the 8051-cored USB micro and the DSPs were way fun (after the learning curve) and really cool 'exotics' to mess with. | |
| |
Re: Missouri must just bide its time waiting for [URL="http://en.wikipedia.org/wiki/New_Madrid_Earthquake"]big ones[/URL]. | |
Re: A for loop typically has 3 clauses, you've got 2. You're not going to execute code inside a loop if that particular hunk of code is itself outside the loop. | |
Re: [url]http://en.wikipedia.org/wiki/COM_file[/url] Hm. I wonder how much of their resurging popularity these days it the "[t]aking advantage of this default behaviour, virus writers and other malicious programmers sometimes use names like notepad.com for their creations." | |
Re: How about first doing it single-threaded and then moving up? | |
Re: [URL="http://c-faq.com/expr/seqpoints.html"]Sequence points[/URL]. [edit][URL="http://c-faq.com/expr/precvsooe.html"]More on sequence points[/URL]. | |
Re: [code]void Rot13(std::string &buffer) { int inc; for(inc = 0;buffer[inc] != '\0';inc++) { if(buffer[inc] >= 'a' && buffer[inc] <= 'z') { if(buffer[inc] < 'n') { buffer[inc] += 13; } [COLOR="Red"]else[/COLOR] { buffer[inc] -= 13; } } [COLOR="Red"]else [/COLOR]if(buffer[inc] >= 'A' && buffer[inc] <= 'Z') { if(buffer[inc] < 'N') { buffer[inc] += … | |
Re: Pay close attention to the names of the functions that you (a) declare, (b) call, and (c) define. Short of this trifecta, you're asking for linker errors. | |
Re: In [icode]stocen[/icode], initialize the array elements of [icode]stevec[/icode] after [icode]new[/icode]ing it. | |
Re: Minor nit.[QUOTE=Ancient Dragon;546354][code] line( int num1, int num2, int num3 ) { n1 = num1; n2 = num2; n3 = num3; }[/code][/QUOTE][URL="http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6"][10.6] Should my constructors use "initialization lists" or "assignment"?[/URL] | |
Re: [icode]*str[/icode] is the character pointed to by [icode]str[/icode], which has type [icode]const char[/icode]. The [icode](unsigned char *)[/icode] cast tells the compiler to convert [icode]str[/icode] from a pointer to a [icode]const[/icode] plain [icode]char[/icode] to a pointer to an [icode]unsigned char[/icode] (the "conversion" itself is likely trivial, though I won't say "it … | |
Re: A random [URL="http://groups.google.com/group/comp.lang.c++/browse_thread/thread/f46c3d9fd0e297f9/206e75a1130506fa?lnk=st&q=overload+member+comparison+function+sort+group%3Acomp.lang.c%2B%2B#206e75a1130506fa"]grab[/URL] or [URL="http://groups.google.com/group/comp.lang.c++/browse_thread/thread/58dcc5d34ebddb9a/f1a268be3405321f?lnk=st&q=overload+member+comparison+function+sort+group%3Acomp.lang.c%2B%2B#f1a268be3405321f"]two[/URL] to start with. | |
Re: [url]http://www.daniweb.com/code/snippet441.html[/url] ? | |
Re: Get rid of these... [code]#include <fstream.h> #include <conio.h> #include <dos.h>[/code]...and discard all the functions you are using from them, such as [icode]gotoxy[/icode] and [icode]cputs[/icode], et al. And if you still want the character-mode stuff, look into [URL="http://msdn2.microsoft.com/en-us/library/ms682010.aspx"]this[/URL]. And, frankly, discard most of what you've learned in "C++" I/O so far … | |
Re: [QUOTE=Ancient Dragon;540079]That wasn't possible when smoking.[/QUOTE]It is quite possible, it depends on the person. Years ago after finishing a couple mile jog the first thing I did was light up. I get more winded these days because I don't exercise much. | |
Re: [QUOTE=jesseb07;543846]hi, this should be a fairly simple question to answer. I have a function in my program that takes the content of a text file and populates an array with all the information. First it has to see how many lines the file has (as it can change) so it … | |
Re: Ought you be passing by reference? Here for example: [code] CartFramePtr head; cart.setHead(head);[/code] | |
Re: If you have to ask about casting, there's a 99% chance that it's the wrong thing to do. | |
Re: cosmos22 -- you're not expecting it to display the image or open a text editor, are you? | |
Re: Consider this: scanf("%s", &tempString); temp->artist = tempString; The second argument to `scanf` is of the wrong type. `temp->artist` is a dangling pointer -- you need to allocate memory for it. You don't copy the string with assignment, look into `strcpy`. | |
Re: Even if I use the correct specifier for a short in sscanf, I see expected results. [code=c]#include <stdio.h> int main(void) { char buffer[100]; struct { float x,y; short dir; float xspeed, yspeed; } user = {123.45,6.789,100,43.21,98.76}, remote; sprintf(buffer, "%f,%f,%i,%f,%f", user.x, user.y, user.dir, user.xspeed, user.yspeed); puts(buffer); sscanf(buffer, "%f,%f,%hi,%f,%f", &remote.x, &remote.y, &remote.dir, … |
The End.