15,300 Posted Topics
Re: You can correct the problem like this: [icode]if ( flag == 0 && (s[i] == '+' || s[i] == '-' ))[/icode] | |
Re: line 18 doesn't work anyway. you can't assign c-style arrays like that, but use strcpy() to do it. Do it like Salem suggested and you can just simply delete lines 17 and 18. | |
Re: 1. functions can not return arrays like you are trying to do. A better solution is to pass a pointer to the array as a parameter so that the function can populate it, like this: [icode] void LongLongToString(long long num, char* string) [/icode] 2. The entire algorighm for that function … | |
Re: [quote="wikipedia"] Hoe may refer to: Hoe (tool), a hand tool used in gardening Hoe (dish), a Korean dish of raw fish Plymouth Hoe A prostitute (slang) [/quote] Sorry, but the Korean's need to rename that fish dish too because it might offend some hores. | |
Re: If you enter [b]prime 7[/b] as the command-line argument then the word [b]prime[/b] will be in argv[1] and '7' is in argv[2], making argc == 3, not 2. argv[0] is almost always the name of the executable program. | |
This is not my work -- don't know the author. [URL="http://www.stltoday.com/forums/viewtopic.php?t=500862&postdays=0&postorder=asc&&start=8"]This[/URL] is where I got it from though. Also found it [URL="http://www.thejokeyard.com/religious_jokes/priest_sipping_vodka.html"]here[/URL] [quote] Sipping Vodka... A new priest at his first mass was so nervous he could hardly speak. After mass he asked the Monsignor how he had done.. The … | |
Re: That was funny :) :) The guy with the lighter could have gotten some very serious burns with that dumb trick. | |
Re: I don't get the point of it, unless its that children imitate adults. And I suspect most adults know that anyway. | |
Re: I didn't take that test because no point in me doing that -- I get lost driving around the block :) | |
Re: [QUOTE=Salem;475114]He probably figures that it's better than "Hey nerds, do my homework".[/QUOTE] I like that title better than the original because its more meaningful | |
Re: you don't program the ports directly but use the installed device drivers. Most common method is to use [URL="http://www.beej.us/guide/bgnet/"]sockets[/URL]. | |
Re: read the articles at [url]www.codeproject.com[/url] Enter [b]CHTMLView[/b] in their search engine and you will get a list of several articles that explain how to use that MFC class. | |
Re: If I comment out lines 49-52 because you didn't post those functions your program works ok for me. | |
Re: the [b]const[/b] keyword tells the compiler that the variable will never ever be changed. Since you expect to enter value for [b]user_height[/b] then it cannot be declared [b]const[/b]. Same with the other variables. | |
Re: >>so the size of the executable may well be a consideration. The size of the executables is not relevent as long as you make sure the computers have sufficient RAM and hard drive space. If the programs are having memory problems then its probably due to some faulty programming, not … | |
Re: The default copy constructor does only minimal thigs -- it is not sufficnet for most classes that contain objects of complex types such as pointers and container classes. | |
Re: [QUOTE=Lardmeister;469159]. It is also illegal to buy/sell/drink beer near a church .[/QUOTE] Apparently that's ok where I live. There is a town about 25 miles from where I live there is a popular bar about 100 feet from the church. Raise hell on saturday night then go to confession on … | |
Re: line 22: you have to give the parameter a variable name. [icode]int F(int &n)[/icode] | |
Re: you could try to rename it, if it failes then its probably in use. | |
Re: >>how do i tell my compiler to use the 32 bit address as a flat address and not as (base:segment). You don't >>have a program in which i would like to hardcode the address greater than 1MB, after enabling A20, and ask the compiler to use all the pointers that … | |
Re: >>but it does not work properly when I check the string length Just add code to call strlen() to get the password length the check if it is <= 9. If you really wrote all that code you posted you should have no problem checking for length. | |
Re: Assuming you are writing a C console program then use the system() function. MS-DOS has been dead on PCs for 10+ years now, but still used in some old embedded systems. | |
Re: You might check with Sybase to see if you can get a version of the library in the language of your choice. They also have free online support forums where you might ask your question. | |
Re: just create a loop that counts from lower_bounds to upper_bounds, and check the value of the loop counter if it is a prime number or not. | |
Re: >>it isn't the best thing to mix io functions from different families but scanf() and fgets() are of the same family of functions, all declared in stdio.h But it is NOT good to use scanf() for string input because it can (potentially) corrupt and possibly crash your program if you … ![]() | |
Re: Your description of the problem doesn't make sense. First you say to initialize all elements of the array to 1. That's simple enough to do. [code] for (int i = 0; i < arraySize; i++) a[i] = 1; [/code] >>Starting with array subscript 2, every time an array element is … | |
Re: I just tried it with VC++ 2005 Express and TC (the original I think, dated 1989). Neither compiler had the problem you report. | |
Re: OMG [sarcasm]You all are just jealous that you didn't get the Nobel Peace Price like Al Gore did the other day :) [/sarcasm] | |
Re: enum getuser1(){ <<< wrong [icode]User1 getuser1() [/icode] <<< right Are you REQUIRED to use enums in this assignment? If not then it would probably be easier just to use const int for each [code] const int stone = 1; const int paper = 2; const int scissors = 3; ... … | |
Re: You can not use atoi() because it returns an int which is probably too small to hold 20 digits. But you can use a 64-bit integer to hold the number and convert the string yourself. >> char c[20] ; Too small to hold 20 digits, you didn't leave room the … | |
Re: I installed XP 64 on my computer once, and removed it about an hour later because nothing worked. It's now sitting in some garbage dump. | |
Re: line 36: delete the [b]endl[/b] from that line because it doesn't go with cin. But because [b]i[/b] is an int you will probably have to flush the '\n' from the keybord buffer, so add [icode]cin.ignore()[/icode] after line 36 and before line 37. line 37: delete this because there is no … | |
Re: If you'd use IE7 on Vista you wouldn't have to worry about those annoying popups. I never get popups (well almost never) unless I click a link to allow them for the current site, including DaniWeb. | |
Re: Contrary to popular belief living humans can not communicate with the dead, either now or sometime in the future. There is no such thing as a ghost. Why? Probably because Heaven does not contain people in human form. After I'm dead I'll try to post something here to let you … | |
Re: strcat() concantinates strings, not single characters. you can do a simple assignment for that [code] char s2[MAX] = {0}; for(int i=0; i < MAX ; i++) { if (line[i]=='\0') break; if ( line[i] != ' ') s2[i] = line[i]; } [/code] The above will fix the syntax error but not … | |
Re: [QUOTE=joshua.tilson;472636]is there some where i can find out about the diferent 's? i know \n and \r now, what other ones are there? [/QUOTE] [URL="http://www.space.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/escape.html"]here[/URL] >>I am also working on the user input problem, will update every one once i figure something I would create another thread and put the … | |
Re: [QUOTE=Salem;473612]Dunno, there's been half a dozen or so trolls all posting verbatim copies of wikipedia and other online resources, often in repeated replies to their own messages. The management should conduct a ban and sweep on them.[/QUOTE] already did that :) | |
Re: >>Could you give some link? Certainly. Logical place is [URL="http://www.google.com/search?hl=en&q=mysql"]mysql site[/URL]? I believe they also have a users group or forum you can join to ask specific questions about mysql. | |
Re: So where did you code the function in line 16 ? | |
Re: The two problems may be related. Don't know the cause or solution. I'd first do full scan for virus with an antivirus scanner then anti-spyware program. If no problems there use one of the many programs that check registry and file system. I think Norton Works will do it but … | |
Re: did you look at those errors and make any attempt to fix them yourself? For example, the error on line 33: you have misspelled the keyword [b]while[/b]. Now, look again and see if you can't see what's wrong. | |
Re: line 4: function names can not contain embedded spaces. Either delete the space or replace it with '_' character. And the first parameter is coded incorrectly. Looks like all you want is a pointer to a double, not an array of doubles [code] int grade input (double *a, double *i) … | |
Re: [URL="http://en.wikipedia.org/wiki/Chicken-and-egg_problem"]chicken & egg proglem[/URL] If the file contains binary representation of integers then the bytes may have to be reversed on the receiving os. This is common problem when transferring files between MS-Windowos and *nix/Unix -- [URL="http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci211659,00.html"][b]big endian little endian[/b][/URL] As for your specific question -- I don't know, sorry. | |
Re: >>But in case you don't have a book... Buy, Beg, Borrow or Steal one. | |
Re: I suppose you think we are that stupid? That isn't your program because it does not do anything that is required in your assignment that you originally posted. We aren't as dumb as you might think we are. Trash that entire program and begin a new one. This time we … |
The End.