3,183 Posted Topics

Member Avatar for dean.n.harris

Is your file already in memory or are you retrieving new strings from the file each time?

Member Avatar for ObSys
0
227
Member Avatar for saimadanmohan

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.

Member Avatar for stevedaniel
0
269
Member Avatar for cambalinho

It's a pointer to `int`, but you want to print a string... How exactly do you want that string to be represented?

Member Avatar for cambalinho
0
5K
Member Avatar for jonathan710

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 …

Member Avatar for Ancient Dragon
0
154
Member Avatar for saja.omarii.7

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.

Member Avatar for saja.omarii.7
0
106
Member Avatar for castajiz_2

C doesn't have a `string` type. Can you be more specific about what you're trying to do? Perhaps post a sample program?

Member Avatar for Ancient Dragon
0
293
Member Avatar for batoul.dje

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.

Member Avatar for richieking
0
112
Member Avatar for COKEDUDE

> 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 …

Member Avatar for COKEDUDE
0
2K
Member Avatar for arkulin

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

Member Avatar for arkulin
0
382
Member Avatar for lrhimma

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 = …

Member Avatar for lrhimma
0
2K
Member Avatar for COKEDUDE

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 …

Member Avatar for deceptikon
0
945
Member Avatar for Elias_2
Member Avatar for cambalinho

Just dereference it: `*obj.Vvariant`. But since pointers to `void` cannot be dereferenced, you still need to cast `Vvariant` to something else.

Member Avatar for cambalinho
0
127
Member Avatar for <M/>
Member Avatar for Derek_4

> 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.

Member Avatar for Derek_4
0
393
Member Avatar for happygeek
Member Avatar for Exinta

In your `FormClosing` event, make sure that `xDoc` actually contains everything you want before calling `Save`.

Member Avatar for Ketsuekiame
0
215
Member Avatar for daino

> 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 …

Member Avatar for daino
0
179
Member Avatar for jaasaria

> what is bs? [BindingSource](http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource(v=vs.110).aspx)

Member Avatar for Begginnerdev
0
963
Member Avatar for jhan.rhey.5

> 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 …

Member Avatar for jhan.rhey.5_1
0
638
Member Avatar for klfrancisco

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 …

Member Avatar for deceptikon
0
321
Member Avatar for Exinta

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` …

Member Avatar for deceptikon
0
2K
Member Avatar for borgasia

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.

Member Avatar for borgasia
0
4K
Member Avatar for Syafiq_1

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 …

Member Avatar for gerard4143
0
190
Member Avatar for rae08

* **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 …

Member Avatar for deceptikon
0
301
Member Avatar for daniel.s.mattos

I'll answer your question with another question: free(thestring); memcpy(thestring,str,strlen(str) + 1); Where does `thestring` point after you call `free`?

Member Avatar for kal_crazy
0
676
Member Avatar for deceptikon

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 …

Member Avatar for Assembly Guy
0
305
Member Avatar for booicu

> 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 …

Member Avatar for G_Waddell
0
463
Member Avatar for Ng
Member Avatar for deceptikon
0
78
Member Avatar for Learner010

> 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 …

Member Avatar for Learner010
0
310
Member Avatar for lrhimma

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 …

Member Avatar for lrhimma
0
207
Member Avatar for xXghostXx

You don't execute any commands, of course the database wouldn't be updated when nothing is done. ;)

Member Avatar for pitic
0
825
Member Avatar for H_beginner

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 …

Member Avatar for deceptikon
0
290
Member Avatar for Samier999

> 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 …

Member Avatar for richieking
0
351
Member Avatar for westsiderailway

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 …

Member Avatar for deceptikon
0
1K
Member Avatar for bhagawatshinde
Member Avatar for salesman91

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.

Member Avatar for salesman91
0
793
Member Avatar for Learner010

> 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 …

Member Avatar for richieking
0
190
Member Avatar for MaddTechwf

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.

Member Avatar for MaddTechwf
0
186
Member Avatar for Learningvinit

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.

Member Avatar for deceptikon
0
119
Member Avatar for clasp1

> 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.

Member Avatar for clasp1
0
653
Member Avatar for Learningvinit

`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.

Member Avatar for Learningvinit
0
523
Member Avatar for COKEDUDE

> 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 …

Member Avatar for Ancient Dragon
0
263
Member Avatar for MaddTechwf

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.

Member Avatar for MaddTechwf
0
294
Member Avatar for sing1006

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 …

Member Avatar for deceptikon
0
213
Member Avatar for asif49

> 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.

Member Avatar for JamesCherrill
0
152
Member Avatar for Sphinx'LostNose

> 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`?

Member Avatar for pritaeas
0
330
Member Avatar for Builder_1

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.

Member Avatar for deceptikon
0
164
Member Avatar for inspire_all
Member Avatar for amina.bm
0
241
Member Avatar for new_developer

> 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 …

Member Avatar for deceptikon
0
1K

The End.