5,676 Posted Topics
Re: [QUOTE=klactose;1131105]Thanks for the reply Salem. Unfortunately I get the exact same error message when I make the declaration "int i;" at the top of the function. So something else afoot. Any more ideas?[/QUOTE] Maybe you need to point out the exact line. Your compiler may not match the numbering on … | |
Re: You need to output the teens OR the ones value -- not both. If output 00,20-90, output 0-9 but if output 10-19 don't output 0-9 | |
Re: [QUOTE=ccie007;1130253]Hi frens, I couldn't compile this solution code given by my university on visual studio.Visual studio works fine with other C++ files.[/QUOTE] Why not? Does your machine crash? When asking for help [I]always[/I] give enough information so someone that is not in your class or can't see your screen can … | |
Re: Yet another way to keep the count: Have an array of 366, maybe call it [ICODE]bdays[366][/ICODE] (one extra to skip day 0) In your code, [ICODE]array[][/ICODE] keeps track of which b'day each person has... So, if [ICODE]array[0][/ICODE] has a b'day on 122, increment it: [ICODE]bdays[array[0]]++;[/ICODE] You've just counted that b'day. … | |
Last night in FireFox 3.5.3 I lost the formatting in all of Software Development. The other communities seem fine. I checked Opera and another computer, all is fine. Other websites seem to be unaffected. I deleted all Daniweb cookies to no avail. I also have no 'attach files' option for … | |
Re: All I know is if governments were people, every one of them would be committed to asylums. And not one seems to have any fiscal sense, nor responsibility. With a "[I]government of the people, by the people, for the people[/I]", how is it [I]the people[/I] keep getting screwed? | |
Re: [QUOTE=Jiwe;1130656]error LNK2028: unresolved token (0A00000F) "extern "C" int __stdcall [B]GetUserNameA[/B](char *,unsigned long *)" [/QUOTE] Where is GetUserName[B]A[/B]() defined? | |
Re: Repost your code. It got lost when correcting the post -- it's not a Code Snippet. What was the value of y[0] before? What does it change to? | |
![]() | |
Re: [QUOTE=NathanOliver;1130537]you are using [icode] cin >> val; [/icode] which will cause an infinite loop to occur if if something other than a char is entered. [/QUOTE] Other than a [ICODE]char[/ICODE]? Like what? If the input requires a [ICODE]char[/ICODE], what can you input that isn't a [ICODE]char[/ICODE]? | |
Re: [QUOTE=vegaseat;1127046]I let you in on a secret, don't tell anybody else, I love to eat out in relatively close by Las Vegas.[/QUOTE] Oh, I thought you were a [url=http://en.wikipedia.org/wiki/Chevrolet_Vega]car lover[/url] :icon_razz: | |
Re: [QUOTE=obih08;1127507]padalhan u naman poh aq ng database program s turbo c sa email q ***[/QUOTE] 1) Put your hands on the proper keys when you start typing. 2) Type full English words, not Gobbledygook 3) If you have nothing to add to [I]this[/I] thread, start your own. | |
Re: If [iCODE]fgets()[/iCODE] doesn't work, I can only think of reading a character at a time.. But, you should [url=http://www.gidnetwork.com/b-62.html]see this[/url] about [iCODE]scanf()[/iCODE] and strings. | |
Re: [QUOTE=KSS;1129564]Also your if clause should be like this: [CODE]If dbltotalaverage >= 90 Then txtgrade.Text = "A" ElseIf dbltotalaverage >= 80 And dbltotalaverage <90 Then txtgrade.Text = "B" ElseIf dbltotalaverage >= 70 And dbltotalaverage <80 Then txtgrade.Text = "C" ElseIf dbltotalaverage >= 60 And dbltotalaverage <70 Then txtgrade.Text = "D" Else … | |
Re: [B]Nathan[/B] is right. Change the [ICODE]for[/ICODE] statement. You can better write the for as [ICODE]for (;!ifs2.eof();)[/ICODE] which is really a [ICODE]while()[/ICODE] Also, as he says, you read off the first line of file 2. Then [code=c++] for( int i = 0; !ifs2.eof(); i++ ){ getline( ifs2, s2 ); // Read … | |
Re: Is [b]and[/b] approved in C/C++ comparisons? | |
Re: To expand on the cryptic "[I]Dont use gets[/I]" statement, [url=http://www.gidnetwork.com/b-56.html]see this[/url]. Caveat: Though I agree wholeheartedly about not using [ICODE]gets()[/ICODE], I would let it go in this and only this program 1) because you declared the arrays as 256 2) this is simply to test the concept of comparing strings … | |
Re: [QUOTE=evstevemd;1129497]Yes Jonsca, I have already read that and I was wondering if there is one single function within standard library. [/QUOTE] No. [QUOTE=evstevemd;1129497]I saw somewhere string::Substr() and I'm trying to check if that is what I want. [/QUOTE] That is one way to do it. [QUOTE=evstevemd;1129497]Anyway the bad of C++ … | |
Re: So? You leave the \n in the buffer and exit? What does [I]that[/I] prove? Try typing "abcdefgh". What happens? | |
Re: I don't see anything glaringly wrong, but since you didn't bother to show us what you are reading, what should have happened, and what did happen, that's as far as I'm going to go with it. Remember, the more details you give, the less we have to guess -- and … | |
Re: You are dealing with floating point numbers. .99 probably is stored as a close approximation of .99, very close. But not close enough. Same with all the other values. Therefore, you have a little wiggle in the values and probably end up with something similar to -0.000000001 as an answer. | |
Re: Buffered output is probably the problem. End the [ICODE]cout[/ICODE] line with [ICODE]flush[/ICODE] to empty the buffer immediately. | |
Re: Yes, except for using [ICODE].eof()[/ICODE] See [url=http://www.gidnetwork.com/b-38.html]this[/url]. [ICODE]feof()[/ICODE] is the same. | |
Re: What's in the file -- a text '0' or a binary 0? [iCODE].get()[/iCODE] only reads exactly what's in the file. It doesn't translate an ascii digit into its binary equivalent. You need to do the conversion. | |
Re: [QUOTE=Fbody;1128937][code] /*part of solution by WaltP */ #define UINT_BITS ( CHAR_BIT * sizeof(unsigned int) ) #define rotateleft(x,n) ((x<<n) | (x>>(UINT_BITS-n))) #define rotateright(x,n) ((x>>n) | (x<<(UINT_BITS-n))) [/code][/QUOTE] Be more careful quoting. I never posted in that thread nor did I write that code. | |
Re: By reading a tutorial. Did you bother to look at the posts at the top of the forum as suggested? Or are you expecting us to teach you post by post? | |
Re: [url=http://lmgtfy.com/?q=TCHAR]TCHAR[/url] As for the [I]other[/I] things, my psychic powers are limited today. Must be sunspots. | |
Re: Brief fix! For something posted 6 years ago? Not brief enough... | |
Re: Read [B]Narue[/B]'s first post (her second was for us, not you) and attempt to understand what she said. [QUOTE=dibbieshir;1127626] This is my code and after it i don't know further after strtok..... I use strtok because some says it is useful to it..... [/QUOTE] If someone said you should use … | |
Re: Head up to Washington an check out Bill Gate's house, Microsoft, Real Player, Google... Wait a minute. This is a vacation... Universal Studios, Disneyland. That's more like it... | |
Re: Don't you have to resize the picture control? Try changing picture1.width and picture1.height instead. | |
Re: Why? Doesn't your book do a good job? Or Google? | |
Re: [QUOTE=DJPlayer;1128280]this is for a C program.. not C++. I posted in here because I was gonna build in C then transform.. so I doubt I can use stringstream.. =/ ugh[/QUOTE] If it's a C program, you need to post it in the C Forum. It doesn't matter what you want … | |
Re: Enter text in the textboxes Select the records from the database and look for a match. If found, open the new form. | |
Re: [QUOTE=vb5prgrmr;1127847]To begin with, this is not a code snippet! It is a question! [code] snipped [/code] [/QUOTE] Did you just hand the answer to them? After over 1000 posts you should know better than that. We [I]help[/I] here. We are not a coding service. | |
Re: First of all, in English there are things called sentences. They use periods at the end and the next sentence starts with an upper case letter. It helps us understand your question. Second, if you'd [url=http://www.gidnetwork.com/b-38.html]format your code[/url], some of your problem would be immediately apparent, and again, [b]we[/b] could … | |
Re: [QUOTE=VilePlecenta;1128359]why not give studying a try [/QUOTE] [url=http://www.gidnetwork.com/b-38.html]Formatting the code[/url] would help, too. | |
| |
Re: And of course, the not-so-smart programmers are cheaper... :icon_wink: | |
Re: [QUOTE=eternaloptimist;1128137]i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8];[/quote] No. You have defined a single character array that hold 8 characters only. You need to … | |
Re: [url=http://www.gidnetwork.com/b-38.html]Format FORMAT [B]FORMAT[/B]!!![/url] | |
Re: You don't really need to use ungetc() for either program. For the reverse a sentence, use the recursive call to simply skip to the next character. Then when you get to the \n, start the return cycle outputting each character. A similar technique can be used for the word. | |
Re: And what's with the mega-indenting? What are you going to do when you have 4 nested loops with IF statements? 4 characters is enough, not 4 tabs: [code=cpp] void countVowels(string a,int& aCont, ,int& eCont,int& iCont, int& oCont, int& uCont) { int nonVowl=0; string.str(a) for(i=0;i<=string.length();i++) { switch(string.at(i)) case 'a': aCont++; break; … | |
Re: Posting bad code badly with no comments is not helpful. Please refrain and stick to asking for help. Or actually, [I]start[/I] asking. You need to learn before you can help. | |
Re: [QUOTE=Fbody;1128051]Grrr.....You're lucky I goofed on the rep button...[/QUOTE] That's OK. I got your back. With teeth! | |
Re: A double post is when the same message gets posted twice. What you did is post more information -- perfectly acceptable. There is no problem making 2 or more posts in a row as long as there is a reason for it. | |
Re: As long as it's a Public Function, which you have, just add the form name: [ICODE]Call Form1.RemoteCalled()[/ICODE] |
The End.