5,676 Posted Topics
Re: Well, you *could* post there and just see how good or bad it really is. Consider it a live test of your thoery that it needs to be split and show the DW designers that the current design is flawed. | |
Re: Look more closely at **("test\\" (variable+".txt").c_str() )**. You are missing something. It's usually better to create complex strings in pieces rather than all in one line like this. Once you get the string generated properly, *then* start combining the terms. | |
Re: > So, Please make it more active and please reply on my post over there now to start from now only ;) So please, if you want it more active, post there. We aren't going to hire people just to post there so it can be more active for you. … | |
Re: Of course it's giving the same seed. `time(0)` returns the current second. So, unless each call to `srand()` if over 1 second apart, the seeds are identical, giving identical random values. | |
Re: > Bob: you'll need to sort the values yourself and find the largest. > > Bob: A simple (though relatively inefficient) sorting routine is the bubblesort, so if you search for examples, that would get you started. > > iamthwee: You will need a loop > > iamthwee: Then you … | |
![]() | |
Re: It's only 7 integers, so sorting is an extra added complexity. It *is* a good way, but if you can't find duplicates, you'll get lost in the sort. Write down 7 numbers randomly on a piece of paper -- making sure to have one duplicate. Now, looking at 2 numbers … | |
| |
Re: > Execution starts from main(), are you allowed to include main() as a member function of a class ? May be I'm wrong. No you are not. `main()` cannot be part of the class. It must stand alone. And `void main()` is wrong. It's `int main()` -- and always has … | |
Re: Did you actually look up the *erase* and *remove* methods of the string class? I'll bet their description would help you determine how and why and which to use. | |
Re: > NathanOliver: And what seems to be the problem? It is asking a lot to give us 600 lines of code and not say what problem you are having with it. > >> poloblue: I'm problems with the studentType header file in this function: Did you miss the part of … | |
Re: Please use *consisent* [formatting](http://www.gidnetwork.com/b-38.html) so we can read the code easier... `return (sales1, sales2, sales3, sales4);` Illegal format. Look up the return statement again... > ... but it does not do the calculation and display the output Meaning what? Nothing gets output? Bad information? Crashes? When asking for help **ALWAYS** … | |
Re: Search for the string. Add the length of the string to the location found Start printing. If you want a better description, give us more information about your situation. | |
Re: Use a loop to calculate successive values of the functions. Use those values to place a point in your output. As for magic++, I've never used it. | |
Re: Problem #1: you claim you're struggling with this code. Problem #2: you give no indication what the struggle is Problem #3: we are not psychic so have no idea what the struggle is Solution#1: read the post at the top of the forum titled "*Read This Before Posting A Question*" … | |
Re: In *normal* syntax, optional values are surrounded with **[ ]**, required are not. And, for this discussion, **#** will designate one or more SPACEs/TABs. What I understand then is you can have the following: [Label] **#** Instruction **#** number1,number2 **#** [; comment] So: A *label* cannot be preceeded by **#** … | |
Re: We really can't get hung up on pos/neg votes. Over the past month I've been downvoted for 1) reversing my stance and stating I now understand a situation and agree with the decision [here](http://www.daniweb.com/posts/jump/1857723) 2) answering questions that help the user [here](http://www.daniweb.com/posts/jump/1833463) 3) explaining the details of a problem and … | |
Re: I was actually happier not knowing about them :o) | |
Re: In `printOut()`, is the value of **n** accurate? Better check... | |
Re: Consider `sizeof` to be similar to `#define`. It is created during compile, not while running. From http://en.wikipedia.org/wiki/Sizeof#Implementation "*In most cases, sizeof is a compile-time operator, which means that during compilation sizeof expressions get replaced by constant result-values."* So you can't write one. You can only write *run-time* code. | |
Re: Then we obviously need more context. Like the function(s) that call this one, the one that opens the file, and the first few lines of the file. And an **exact** descripton of what's going wrong with as much detail as you can provide. | |
Re: > It used to be a connotation that it was a gay colour (Lesbian?) It's also a connotation of Royalty. Guess which was first :) I thought lavender was gay. Good thing this isn't BruciWeb... ;) | |
![]() | Re: Since this has nothing to do with C it should be posted elsewhere. Like Geeks Lounge. |
Re: Why are you using command line parameters (`argc/argv`) for this? Are you guaranteed that the file has the correct data so you don't need much error checking? If so, you can use `fscanf()` to read the values. If not, use `fgets()` to read a line and check if the correct … | |
Re: OK, this is getting really annoying! I spent 7 minutes trying to add a reply earlier and this CODE Detection would not let me add the post. It detected code. The post in the preview looked exactly the way I wanted it. But the code detection would not let me … | |
Re: What is wrong? Please give details. What actually is displayed? (actual text) And what's wrong with this? What do you want displayed? (actual text, variable names, etc) Examples help greatly. | |
Re: Instead of for ( int i = 0; i <= NumUsed; i++ ) { for ( int j = 0; j <= NumUsed; j++ ) { cout << List[i][j]; } } try for ( int i = 0; i <= NumUsed; i++ ) { cout << List[i]; } | |
Re: Store them in a file that the program will read. Use a code that tells you what the file entry is, like Ffilename.ext RregistryKey Vvalue Etc... | |
Re: [This will help](http://lmgtfy.com/?q=BSP+tree) | |
Re: It's hard to do two things at once. Try doing the sort first. Then look for the duplicates. | |
Re: Not quite. After you input all the numbers, set **min** to **arraySize[0]**. Then you code should work fine. | |
Re: `Card[nCards]` is one beyond the array definition. Since you allocated **nCards** integers, your last available value is `Card[nCards-1]`. | |
Re: Depends. What issues? They aren't secret issues, are they? | |
Re: I don't understand the term "*some sort of error*". Post the error. Don't take a picture of it and link. > Also, I noticed that it didn't add quotations and curly braces automatically when I created the first one. > The .cpp file was completely empty so I had to … | |
Re: It's because `node->data = data;` stores the address of your variable **input** into the node during the first pass through the loop. Next time through the loop you enter a new word into **input**. Since all you stored is the address of **input** and not the data itself, the data … | |
Re: > hey, i tried a lot, i made it all I see no code to show us what you tried so therefore cannot help you fix it. Unless, of course, you want us to write it for you... | |
Re: Don't new people bother looking at dates? This thread is only 3 years old... :eek: | |
![]() | Re: > The publicity team for Technozion is in full swing. Like every year, this time too, the team is planning to visit N different colleges in India. This publicity campaign shall involve the members of the team giving presentations... How about presentations on "*The Benefits of Using 25-year-old technology (TurboC) … ![]() |
Re: > For Example: > char *c; c="END"; c="BEGIN"; No errors **"END"** and **"BEGIN"** are by definition allocated sequential memory during compile time. Then `c="END";` simply loads the address where **"END"** is defined into the pointer **c**. Same with `c="BEGIN";`. It's simply loading a new address into the pointer. > while … | |
Re: > I've used malloc countless times, but as far as I know, reading and writing to memory that isn't expressly yours (which is in fact done by the malloc function) causes a segfault... So why doesn't malloc generate segfaults? For the same reason when you fly to Pheonix and rent … | |
Re: What I would do in this case is print out values the program calculates at key places and see what the variables contain. For example After line 29 output *computerguess* After line 41, 76, 85 output *computerGuess, lowLimit, highLimit* An example, after 76: `cout << "In setLimits (high)" << computerGuess … | |
Re: Use CODE Tags!!! Do you have a question or do you just want us to test it for you? | |
Re: You forgot the part about it being undefined behavior... ;o) | |
Re: Another idea for finding the min and max grade: Input midtermgrade set Min and Max to this grade (one of them *could* be true) input projectaverage test with Min & Max and replace if necessary input papergrade test with Min & Max and replace if necessary This way you won't … | |
Re: Start by writing a piece of code with two pointers and known contents. Output the value of the pointers and the data that they point to. Now, do both increments on the two pointers. Next, output the value of the pointers and the data that they point to again. Last, … | |
Re: > ... and was just wondering if its possible to make a simple program where you type the name of the file and when you press enter it downloads that file from the internet to a certain place on your computer. Of course it is. > where would the files … | |
Re: 512 in binary is 10 0000 0000 The int is probably 2 bytes (guessing by your name you're using Turbo C) So **i** contains (0000 0010)(0000 0000) typecasting **i** to the character **c**, **c[0]** is (0000 0000), **c[1]** is (0000 0010) Replace **c[0]** with (0000 0010) makes **i** (0000 0010)(0000 … ![]() | |
Re: Standard C++ does not allow this. Only a couple compilers have extensions that will, but learning to rely on non-standard functionality hurts you when you need to use different compilers. | |
Re: Ahh, we're playing [Jeopardy](http://en.wikipedia.org/wiki/Jeopardy). OK. The question is: *How can I read the file and store student information?* Did I win? ------------------- In answer to your non-question, looks like either idea would work... |
The End.