5,676 Posted Topics
Re: [QUOTE=lotrsimp12345;1164978]IT doesn't enter second loop don't know why. Any suggestion?[/QUOTE] Yep. Split [ICODE]for(int k=0; k<getphraselength(); k++)[/ICODE] into 2 statements. What call the function every time you go through the loop? Make it: [CODE] len = getphraselength(); for(int k=0; k<len; k++)[/CODE] Now you can display [I]len[/I] and see if the value … | |
Re: [ICODE]str[/ICODE] is a pointer to a character array. Assume [ICODE]char *str = "ABCDEFG";[/ICODE] The first character in the array, 'A', can be represented as [ICODE]*str[/ICODE] -- contents of str [ICODE]*(str+0)[/ICODE] -- contents of 0th element of str Expanding this last one, [ICODE]*(str+3)[/ICODE] -- contents of 3rd element of str: 'D' … | |
Re: What have you tried? What did it give you? | |
Re: Maybe you and [url=http://www.daniweb.com/forums/thread269114.html]MKS200[/url] should get together... | |
Re: It's obviously code they were given by the instructor, and they both want us to finish it for them. | |
Re: As jbennet said a year ago when this thread was resurrected then: [QUOTE=jbennet;916880]Was there a point to awakening an old thread?[/QUOTE] | |
Re: [QUOTE=web81;617933]Hello all can you help me up with this guys.. i have this application with a product id which is in Hexadecimal format..wat i mean is an alphanumeric format.. and it is asking for a product key.. how can i suppose to know the product key? can you give me … | |
Re: Search for the proper software. If you want to do it yourself, check into some universities that have curriculum for computers and vision analysis. | |
Re: [QUOTE=khevz09;1164421] can u give me some advice because i really need it ...... Thxxx[/QUOTE] First, figure out what you want to do. Next, write down all the features you need in the program Start designing these features -- one at a time. Use as much detail as possible. Pick the … | |
Re: Your first problem is that [QUOTE=jaymeaux77;1158689]Like I said most of it is still half written and Im still fidgitting with it. [/quote] Stop fidgitting with it. Take one task, write it. Test it. Perfect it. Then move to the next task. I'd recommend starting with the display function. Write it … | |
Re: Of course it's necessary. And useful. Look up it's uses. | |
Re: He means "[I]Never [B]write[/B] code straight into your editor (from out of your head) without first writing it on paper and desk checking it.[/I]" | |
Re: [QUOTE=Xufyan;1162174]Can anyone explain whats wrong with this program [/quote] [ICODE]void main(void)[/ICODE] - [url=http://www.gidnetwork.com/b-66.html]see this[/url] [ICODE]clrscr ();[/ICODE] - very old non-standard function that hasn't existed since 1986 [ICODE]getch ();[/ICODE] - non-standard function that is very non-portable, works in very few compilers and [url=http://www.gidnetwork.com/b-38.html]no formatting[/url] making the program hard to follow. | |
Re: [QUOTE=dude1;1159731]can anyone give me some hints on this im having issues thanks[/QUOTE] Biggest issue is not reading the rules and posting any information at all about what those issues are. We can answer specific questions, but if all you're going to do is talk in generalities, the only help we … | |
Re: What is it defined as? Where/how is it used? Does the use and the definition match? And please [url=http://www.gidnetwork.com/b-38.html][B]format your code[/B][/url]. If it gets any longer and more complex, we won;t be able to follow it. If you want more help, you [I]do[/I] want us to be able to read … | |
Re: [QUOTE=Banfa;1163655]With thanks to Firefox for its ability to highlight the word salary[/QUOTE] Not the point. And what if the variable name was [I]salry[/I]? | |
Re: [url=http://lmgtfy.com/?q=function+c%2B%2B]Try This[/url] | |
Re: [CODE] cout <<"Continue? Enter y or n"<<endl; cin >> c; // put answer in variable c tolower('c'); // convert the character c (not the variable) to // lower case and throw away the conversion // -- didn't put it in a variable if (c == y) // compare the variable … | |
Re: I don't see an error message posted nor a line number pointed to. You might want to give us ALL the details, not just some of them. | |
Re: I agree with [B]David[/B] (except there's only one sentence :icon_wink:) The memory aspect actually is more confusing, so don't mention it. It seems immaterial to me in a description unless you are describing the lowest level of programming. | |
Re: Isn't this basic math? If you know the terms (slope, axis, etc) you already know (or can find) the correct equations. Turn them into code. | |
Re: [QUOTE=timbomo;1160025]i want to figure out a way other than a switch statement that will show the user how many gallons of paint are needed when the user says how many square feet they have. [/QUOTE] If you don't want a [ICODE]switch[/ICODE] statement, use a series of [ICODE]if[/ICODE] statements. | |
Re: You don't need to make your questions into comments. They are not code. As for making the file, try Notepad.exe | |
Re: [QUOTE=eternaloptimist;1163477]i need a function to line up the info with these columns.: Name Test 1 Test 2 Test 3 Average here is the code that i have so far.: #### thanks to anyone who helps me with this.[/QUOTE] I don't see any attempt. There is nothing to help with yet. … | |
Re: You'll really have to scan the file for the line. There's no telling where any specific lines start. | |
Re: Then look at your [iCODE]for[/iCODE] loops. Are the middle comparisons correct? | |
Re: Open the file in WORD and output the file as TEXT. | |
Re: Mistake #1: [ICODE]system("pause");[/ICODE] [url=http://www.gidnetwork.com/b-43.html]Here's why[/url] Mistake #2: No formatting. [url=http://www.gidnetwork.com/b-38.html]See this[/url]. If we can't follow your code, it's hard to help. Mistake #3: Not posting the [I]exact[/I] error message. | |
Re: [QUOTE=bigt666;1160992]This is the code: [CODE]//---------------------------------------------------------------------- // // This lab exercise is to practice rand(), srand() and // output formating with help of <iomanip>. It also practices // file input and output. // // Add a text data file to your project called "lab_4_data.txt". Put the following // numbers in it: … | |
Re: Depends on how large it is. It works just fine for small arrays -- say 1000 or less. Larger than 10,000 you might want to try something else if the sort takes too long. | |
Re: To be honest, I think Excel would be better than trying to learn C/C++ to do this. It's made for on-the-fly computations. It also makes it very simple to compare possibilities. | |
Re: In addition to what [B]Banfa[/B] said, you need to learn [url=http://www.gidnetwork.com/b-38.html]formatting[/url]. Your code is completely unreadable. You should not ask someone else to try and help you with code that cannot be followed. As for lifelines, you need to keep track of all three individually. Use an array. | |
Re: 1) Speak English. [I]nid?[/I] Use sentences. Violation of the Rules. 2) Give you code? Why should we do something you're not willing to do? What's in it for us? Violation of the Rules. 3) ASAP? What makes you so blamed important? All these other member's posts are less important than … | |
Re: I'm with [B]bumsfeld[/B] on this one. You want as much precision as you can get throughout the program's calculations and only round for the display. You don't even want to round the number itself, just the display. If you round prematurely, all your calculations will be slightly off. And the … | |
Re: No, peep, we don't. That's why it's [I]encoded[/I]. So you can't decode it. :icon_rolleyes: | |
Re: [QUOTE=endframe;1163276]Do you mean doing the IF statement that declares the number being even or odd, I mean this one: [QUOTE]if (x%2==0)[/QUOTE] But then what to do? I understand that we need to make a count but I don't know how. [/QUOTE] You don't know how to do [ICODE]d = d … | |
Re: Read the FAQ in the site you linked. All the information is there. | |
Re: 3 loops all using [I]number[/I]. You should know by now we need details, not vague descriptions. And if you are passing values back from functions, pass them back. Don't use [B]void[/B] functions. That's why they designed [B]int[/B] functions. | |
Re: I don't see any writing to any file. You might want to open/write/close a file and you might get banana into the file. | |
Re: What is the value of [iCODE]std::string::npos[/iCODE] when the loop starts? Looks like a [iCODE]do-while[/iCODE] would work better here. | |
Re: How can we help if you don't tell us what the problem is. | |
Re: [QUOTE=lugan;1162550]The array is 200,000 because the string can have up to 200,000 characters inputed in it.[/QUOTE] Why? Read one character at a time. You need 1 character, not 200K. | |
Re: I don't think I understand the problem. Are you looking for a '\n' right now? Where? Do you want to use a ';' instead? Isn't this fairly obvious? | |
Re: Reading again after you already reached the end of the file. | |
Re: Hijack thread? He never mentioned hijack thread. Hijacking has nothing to do with this thread except it deals with new members not bothering to follow rules. | |
Re: [ICODE]if (teamScore ==1 && teamScore != -999)[/ICODE] If team = 1 it can't be -999. Simplify both [ICODE]if[/ICODE] statements [CODE] cout << "Team 1" << score1 = sum + numPoints; cout << "Team 2" << score2 = sum + numPoints; [/CODE] Did they both score the points? Once the output … | |
Re: 5% doesn't mean anything in code. | |
Re: [QUOTE=photoyid;1162356]BTW, the iostream.h vs iostream is a stylistic thing which was inherited from C. The C style was to use iostream.h, in C++ it isn't necessary.[/QUOTE] It's not a stylistic thing. The .H forms are deprecated and do things differently than the non .H form. The standards have moved forward … |
The End.