3,183 Posted Topics
Re: Is your file already in memory or are you retrieving new strings from the file each time? | |
Re: Walk over the source once. Keep a reference to the first match and as long as the source matches the pattern, walk over the pattern too. If the pattern reaches the end of the string, you have a complete match. Otherwise, reset the pattern and start over. | |
Re: It's a pointer to `int`, but you want to print a string... How exactly do you want that string to be represented? | |
Re: There's nothing in those snippets that would make me suspect the map as cause for a memory leak. If the map itself is confirmed to be using "lots" of memory, my first question would be how many phone numbers are stored, and are all of them validated to actually be … | |
Re: Yes we can. We *won't* though, as you'd learn nothing by being given the code for your homework exercise. However, we can help you along if you post your code and describe what you've tried as well as how it didn't work. | |
Re: C doesn't have a `string` type. Can you be more specific about what you're trying to do? Perhaps post a sample program? | |
Re: Can we help? Absolutely. *Will* we help? That depends solely on how much effort you're willing to put in. If you just want someone to do it for you, you'll get no help. Our homework rule is very clear on that matter. | |
Re: > Is that corrrect? Not at all. Have you checked a C reference manual? The only similarities `fgetc` and `fscanf` have is they read input from a stream, and fscanf can simulate `fgetc`. The people you were arguing with, what were their points? Perhaps we can clear up any errors … | |
Re: You can get the most recent identity with `scope_identity()`: begin insert into np_Profesori (Ime, Prezime) values (@ime, @prezime); select @id = scope_identity(); insert into npGdjeRadi (IDProfesor, IDFakultet) values (@id, @fakultet); insert into np_DodavanjeProfesora (IDProfesor, Added, AddedBy) values (@id, @added, @addedby); end | |
Re: Is a hard 5 digit sequence required? If all you need is something that's larger than the previous ID and smaller than the next, you can use the custom date time formatting to get a high enough resolution that practically guarantees uniqueness: ' Timestamp down to the millisecond Id = … | |
Re: Either one would work, and neither will negate the very clear issue of having two pointers and an integer for *every* character stored in the list. This is excessive memory usage that can and probably should be mitigated by storing an array of characters in each node rather than a … | |
Re: Just dereference it: `*obj.Vvariant`. But since pointers to `void` cannot be dereferenced, you still need to cast `Vvariant` to something else. | |
Re: > I listed this in the C++ category. To clarify, did you intend to do that? If not, I'll move the thread. If so, please explain how this thread is relevant to C++ since the code you posted is clearly Java. | |
Re: > What I can do in one mouse click in XP takes up to 30 seconds to accomplish in 8. Examples? | |
Re: In your `FormClosing` event, make sure that `xDoc` actually contains everything you want before calling `Save`. | |
Re: > Oh really? Yes. The bit pattern will be different depending on the endianness of the architecture. There aren't any rules aside from being aware of the architecture and matching it, but a common guideline for portable code is to always use the same endianness for sharing bytes regardless of … | |
Re: > what is bs? [BindingSource](http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource(v=vs.110).aspx) | |
Re: > can anyone make a code for this problem.? Yes, yes we can. But we *won't* because that defeats the purpose of the exercise which is for *you* to learn how to do it. If you have problems with your code, feel free to ask, but don't ask someone to … | |
Re: The short answer is that you can't control the user. Accept any string and then validate that it's what your program can process. If it isn't discard the string and ask for another one. The long answer is that you *can* do it, but it's more trouble than it's worth … | |
Re: You're not seeing results because you're creating a whole different `Main` form object and calling the method on that one rather than the actual main form that's been shown. In this case I'd add an event to your `Settings` form that gets fired when the button is clicked. The `Main` … | |
Re: The error is very clear, you can't have a `ref` parameter that's a property. Copy the value of the property into a temporary variable, then after the method returns, copy that temporary variable's value back to the propery. | |
Re: You can, but functions must be declared before their first use, which means you need to add prototypes for the formula functions before `main`, and the definitions after `main`: #include <iostream> #include <stdlib.h> using namespace std; double fIntoCm(double dIn); double fYtoM(double dY); double fOtoM(double dO); double fMtoKm(double dMl); double fCmtoIn(double … | |
Re: * **Ease of use**: Really depends on what you're used to. Both are user-friendly, IMO. * **Availability of Software**: Depends on what software you want. Games are notable in being more available on Windows, but that's slowly changing. * **Overall Security**: This is a tough one because security is dependent … | |
Re: I'll answer your question with another question: free(thestring); memcpy(thestring,str,strlen(str) + 1); Where does `thestring` point after you call `free`? | |
This will be a relatively quick article because it's a simple issue. The `system` function gets a lot of flak for being slow because it calls the shell runtime to execute a command, but I rarely see the more devastating issue of security brought up. `system` is insecure in many … | |
Re: > Are we slowly turning ourselves in robots? You've asked this question with the implied assumption that the result is *bad*, which hasn't been convincingly argued. What's inherently wrong with being partially "robotic"? Until we have a basepoint for discussing the ramifications intelligently, we need to move away from irrational … | |
| |
Re: > Actually some of my friends often say me that pointer is hard , too hard(however i've not started learning pointers , so i can't say). I strongly believe that the majority of what makes pointers "hard" is people hyping them as such. The concept is very simple, and the … | |
Re: Let's get one thing clear first, are you using a hardware barcode scanner or do you need to recognize barcodes on an image that's stored on the file system? The two are different beasts, and the former will typically be easier because a hardware scanner will just give you a … | |
Re: You don't execute any commands, of course the database wouldn't be updated when nothing is done. ;) | |
Re: Separating the check for end-of-file from the actual read is risky, and you're encountering a very common beginner's problem with it: the last line gets processed twice. This is because the eof member function won't tell you that the *next* input request will hit end-of-file, only whether the previous one … | |
Re: > if you could solve this program please i really need it today . Welcome to reality. Many of us have worked with someone who cheated their way to a job and couldn't perform. It's not a good situation for a team, so you'll probably get no sympathy. Next time … | |
![]() | Re: I'm not a fan of tight coupling between forms such that you access internals of other forms directly. My preferred method is to communicate data with either constructor parameters, properties, or events. For example (unnecessary stuff omitted): Public Class Form1 Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click … |
| |
Re: Please post your code. The exception is clear about what the issue is, so you need to look into why the path you're trying to save is interpreted as being empty. Most likely it's getting cleared somewhere. | |
Re: > why both are same ? The array index operator is syntactic sugar for an offset from a pointer. The pointer is the base address of the array, so `a[0]` is equivalent to `*(a + 0)`. Because addition is commutative, you can also say `*(0 + a)`, which falls through … | |
Re: ASP.NET? WPF? Old school WinForms? What technology are you working with, because there are subtle (and sometimes not so subtle) differences between controls with the same name. | |
Re: Improve it *how*? Make it shorter? Make it faster? Make it more intuitive? You need a specific goal, and "improve it" is not specific at all. | |
Re: > However, how come it was possible to use such C++ instructions such as ofstream file; and such in a windows form application? Because C++/CLI would be far less useful and attractive if you were denied any of the standard C++ libraries in managed code. | |
Re: `counted_ptr` isn't a standard class, which means you're trying to use a third party class. Where did you get it? How you use it greatly depends on how it was written to be used. | |
Re: > I first used malloc to allocate some space. Then I use this if statement to fill vertices with some char values. After that I add a null character at the end so it is properly terminated like char arrays are supposed to be. Then strlen should work. Could you … | |
Re: Out of curiosity, since you're authenticating with LDAP, why not use LDAP for gathering user information as well? It sounds like the basic information is already part of an AD user record, so there's no point duplicating that information in another database. | |
Re: I'm going to go out on a limb and guess that what you want is to clear the screen when redrawing the menu. This will keep the menu in the same physical location for each iteration of the loop. Since you're calling it "DOS" I can only assume you're using … | |
Re: > the doThis() method is in a different class That doesn't change anything. `doThis` is still passed a reference to the object, and `copyOfX` still makes a copy of *only* the reference. All references still point to the same underlying object. | |
Re: > Personally I would only use async/await if you're running on the UI context as I believe that's the entire reason it was designed (to prevent blocking the UI thread) So in your opinion it's just a more convenient form of `BackgroundWorker`? | |
Re: If by "help" you mean "do it for me", then no. If you really *do* mean help, you've provided precisely zero information useful for helping you. Either way, the question as it stands now is guaranteed to go unanswered. Please provide more information and show some effort. | |
Re: Required watching for P and NP: https://www.youtube.com/watch?v=msp2y_Y5MLE | |
Re: > Isn't there a way to check an array is initialzed by any values(int, double). Not without some scaffolding in place to help. Consider an array of `int`. Regardless of whether the array is initialized or not, all elements contain an integer value. The difference is that an an uninitialized … |
The End.