15,300 Posted Topics
Re: >>Do not use nickel and half-dollar coins. half-dollars I can understand because they are not very common. But nickels??? :icon_eek: As a customer I would not like it if the cashier gave me seven pennies when he/she had a nichel in the drawer. | |
Re: convert the integer to std::string (use stringstream for that), insert the commas, then display the string. There is no function that will do it for you. If you use C#, VB.NET or C++/CLR you're in luck because [URL="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx"]WriteLine() [/URL]can do it. | |
Re: do you have to use a vector? It would be simpler to just use a std::string. | |
Re: java is pretty much operating system independent, meaning write it once and run it with no further action on any os that supports java. C and C++ languages are not -- that is you have to compile it for each target operating system. On MS-Windows you could write the C … | |
Re: That file does not contain a class names CNode. And post your attempt to solve the problem. | |
Re: pass it the same as anything else [code] void foo(char *c) { } int main() { char c = 'A' foo(&c); } [/code] | |
Re: Deposit $10,000.00 USD into my PayPal account and I will do it for your. Otherwise, spend some midnight oil and do it yourself. | |
Re: an unsigned char variable is only a value between 0 and 255 (0 and 126 signed). That means it can only contain a single numeric digit -- if you look at [URL="http://www.asciitable.com/"]any ascii chart[/URL] you will see that the digit '0' has a numeric value of 48, the digit '1' … | |
Re: you mean something like this? You can either provide a file name on the command line or redirect a file into the program like this: [icode]myprog <main.cpp[/icode] [code] void foo(istream &in) { string line; while( getline(in, line) ) cout << line << '\n'; } int main(int argc, char* argv[]) { … | |
Re: Yes of course it can be done. Suggest using [URL="http://curl.haxx.se/libcurl/"]cURL library[/URL]. | |
Re: Welcome to 32-bit programming :) [URL="http://www.beyondlogic.org/porttalk/porttalk.htm"]Read this article[/URL]. | |
Re: [QUOTE=Paul Thompson;1133244]And also give them the power to be able to ban users with spammy sigs! That ReplicaWatches thing is really annoying me :S[/QUOTE] If they did that then DaniWeb would lose 95% of its members, including yourself. | |
Re: What language did you use to write that program? In C and C++ there are a few win32 api function calls you need to make in order to make the program run with admin privileges. See [URL="http://msdn.microsoft.com/en-us/library/aa379306%28VS.85%29.aspx"]this article[/URL] and the links at the bottom. | |
Re: go back to school and get a degree. If you can't get a degree because you can't do the work then just to go McDonalds and flip hamburgers for the rest of your life. Also check with some of the temp employment agencies in your area to see if you … | |
Re: The rule is -- one free() call for each malloc() or calloc() call. You can not free() something that was never malloced. In the case of the linked list, each node of the list was allocated by calling malloc(), therefore each node must be destroyed by calling free(). In the … | |
Re: [QUOTE=mrk258;1132812]my keyboard is not working with window vista[/QUOTE] [URL="http://www.youtube.com/watch?v=PFcL6hiyyuc&NR=1"]Here is a Tutorial [/URL] that shows you how to fix it. | |
Re: On line 8 print the value of s on each iteration of the loop then you can see why you get that output. If you use a scientific calculator you will see that (1 & 128) is 0. Then 128 > 1 is 64. (1 & 64) = 0. 64 … | |
Re: First move lines 15, 24 and 26 down into fillcities() function. There is no reason for ifstream to be global. You can combine lines 38 and 39 like this: [icode]while( getline( infile, CityName ) )[/icode]. There is no need to use eof() like that because it doesn't work the way … | |
Re: Don't type in all upper case because it means you are screaming and yelling at us. You need to understand pointers if you want to understand that program. [URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]Here is a good paper[/URL] on pointers by DaWei | |
Re: [QUOTE=GrimJack;1105420] Plus there is the whole 'separation of church and state' thing[/QUOTE] There is no such thing as "separation of church and state". The US constitution just prevents the US government from passing certain kinds of laws concerning religion, it does not prevent it from practicing a religion. And the … | |
Re: You don't use strlen() to get the length of std::string object -- use its length() method [code] if( f.length() < s.length() ) { swap(f,s); } [/code] Now do that for all combinations if the strings f, s, t, and fo; Also, a much better way to format your code is … | |
Re: My guess is that you are trying to create the table every time you run that program. Delete line 5 and try it again. | |
| |
Re: zlib I think was written in C language, not C++. If you want to compile it as c++ then there will most likely be a lot of places that require minor changes, such as typcasting void* to something else, such as [icode]zcpr.next_in = (Bytef *)FilePtr;[/icode] | |
Re: what are the error message(s) ? lines 9 and 19: why did you stick those returns in the middle of those if statements? That makes line 10, 11, 20 and 21 unusable because they can never be executed. Mising } between lines 12 and 13. | |
Re: 12 years old??? you should be skateboarding and hanging out with kids your own age, not saying by yourself if your house at a computer. This is the time for you to be a kid and learn how to socialize with other people. BTW: unix operating system was written in … | |
Re: just add showArray() function call on line 51 of the code you posted, just before the end of that do loop. | |
Re: >> setw( 10 ) << 3 That, in C would be [icode]printf("%10d", 3);[/icode] >> setprecision( 2 ) That's the same as [icode]printf("%.2f", sales[ i ][ j ]);[/icode] | |
Re: In C and C++ languages array subscripts begin with 0, not 1. So line 24 should be [icode]t[0] = ...[/icode]. Other lines in your program need to be adjusted accordingly, such as use t[0] and t[1]. | |
Re: If you know the buffer will need 8 seconds of data then why not just allocate it all at the same time? Calling realloc() will work too, but will be more time consuming than allocating it all at the same time. | |
Re: Are you executing bcc32.exe from a command prompt or from Windows Explorer? You can't do it with Explorer. | |
Re: I suppose you could multiply everything by 100 do the integer division, then divide the final result by 100. But 14.3 can not be stored as an integer, so I assume you will just want to print it, such as [icode]printf("%.1f\n", (float)1430/100);[/icode] | |
Re: You can try MinGW, which is the MS-Windows port of g++. Download it directly or get it with Code::Blocks IDE. If MinGW doesn't support the files then you will have to redesign some parts of your program. | |
Re: [QUOTE=suta6;1079803]Question 1: [CODE]main() {int i=-3,j=2,k=0,m; m=++i||++j&&++k; printf("\n%d%d%d%d",i,j,k,m); } [/CODE] ans is -2201 how?[/quote] There are no spaces in that printf() statement to separate the numbers. | |
Re: [QUOTE=Daishi]Woah woah woah. What's so illegal with 'i=i++'? Wouldn't it just try to increment i, and then set i equal to the original value of i, making the ++ do effectively nothing? That's what it does when I try it, but I don't have a straight C compiler handy.. -Fredric[/QUOTE] … | |
![]() | Re: read each line of the file, then search the line for each of the key words you want to use. For example [code] std::string line; if( line.find("VELOCITY") != string::npos) { // blablas } else if( line.find("LAT_1") != string::npos) { // blabla } // etc. etc. [/code] >>I'm just beginning to … ![]() |
Re: I have the output window always docked at the bottom of the screen so that its always visible and not a popup. On my setup what you are calling the Error List window is the same as the output window, that is the error list is shown in the Output … | |
Re: [URL="http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=c%2B%2B+makefile+tutorial&btnG=Google+Search"]Tutorials[/URL] | |
Re: [b]The Dude[/b] Every community needs a jester and The Dude acts in that capacity at DaniWeb. He always puts a big smile on my face with his humerous and sometimes informative posts in the Geek's Lounge. The Dude is to DaniWeb that Jerry Lewis, Lucille Ball, Jonathan Winters, Benny Hill … | |
Re: google is your friend. [URL="http://www.macs.hw.ac.uk/~rjp/Coursewww/Cwww/tree.html"]Here is a binary tree program[/URL] written in C that was at the top of the google links. All you have to do with it is change the tree nodes to hold strings instead of integers and add an integer counter to count the number of … | |
Re: >>How to do fancy stuffs using C/C++? Go to [url]www.codeproject.com[/url] and there you will find hundreds of programs/tutorials that do fancy stuff. | |
Re: Welcome to DaniWeb. Where are you from anyway? Never heard of the name Nidhi before. | |
Re: [URL="http://cdburnerxp.se/"]This program[/URL] works for me, but I don't know if it will read those MAC files or not. | |
Re: San Francisco is "overseas" ??? OMG! Don't be surprised if you see a lot of men holding hands with other men in that city because it's one of the biggest gay cities in the USA. In 6 weeks it will be sprint time there so the weather should be pretty … | |
Re: [QUOTE=firstPerson;1116756]Sure potential is an important quality, but would you hire a dull person to make a software for you company, even if that dull person has potential? Or would you hire a "*smart" person for that same job? Remember its you ass on the line. ------------------------------------------------------------------------------------------ * whatever smart means … | |
Re: Check to see that <cstdio> was included and not <stdio.h> | |
Re: You have to specify the full path to the new folder, otherwise it will just get created in the current working directory. [icode]sprintf(dirname,"/usr/include/somewhere/test%d",i);[/icode] | |
Re: I have not seen a football game (EU version, not American) since mid 1970s when I was stationed at RAF Mildenhall, Englahd. At that time it was just as much fun watching the fans get into big fights as it was watching the game. Do the fans still do that??? |
The End.