3,183 Posted Topics

Member Avatar for shanki himanshu

Off the top of my head, I'm going to say that it's not possible to mix and match %f (which supports a precision) and %g (which has a zero removal rule). You'd need to use a less direct solution, such as sprintf() followed by a right trim of zeros.

Member Avatar for deceptikon
0
153
Member Avatar for notconfirmed

Your best bet is to try running Mono on the machine and hope for the best. However, there's a fairly strong likelihood that your code uses .NETisms not available in Mono and will require modification to port it.

Member Avatar for deceptikon
0
1K
Member Avatar for diafol

It's no longer embedded in the post, but the file is still attached. You can remove it entirely through the same process that you added it: 1. Edit the post 2. Click the Files button 3. Click the 'Delete' link next to the attached image (where the embed buttons are)

Member Avatar for deceptikon
0
212
Member Avatar for fyra

> I'd like to know if I'm doing the allocation of memory from data to new_data correctly Looks like it, at least if set is implemented the way I'd implement it using that interface. > why new_data only has one value since the memory of data was copied before to …

Member Avatar for fyra
0
282
Member Avatar for otengkwaku

> is `char** val` the same as `char* val[ ]` *Only* as formal parameters in a function definition. Otherwise, they're not. I'm assuming we're talking about parameters for the answer to your next question. > when is the formal (`char** val`) used I'll use the array notation when I'm absolutely …

Member Avatar for otengkwaku
1
404
Member Avatar for shujat132

> Also please tell me about these error. You forgot to list the errors, and your title for this thread is uninformative.

Member Avatar for otengkwaku
0
167
Member Avatar for killer88

Why are you using a Textbox? Just use a NumericUpDown control with the default set to 0. Not only will this correct your immediate problem, it also saves you all kinds of trouble in verifying that the "values" are actually numeric.

Member Avatar for killer88
0
302
Member Avatar for visweswaran28

> I tried to load the above string in XMLdocument, but I used to receive an exception. You didn't follow up on the answers from your previous thead about that exception, so why should I bother trying to help again?

Member Avatar for deceptikon
0
134
Member Avatar for Reverend Jim

> I'm not James :/ That's a good thing, because then Daniweb would crash due to overflowing awesome. ;)

Member Avatar for Reverend Jim
0
166
Member Avatar for joshl_1995
Member Avatar for joshl_1995
0
217
Member Avatar for visweswaran28

> I received an exception when I tried to pass the above string. What exception did you get and which version of the .NET framework are you compiling against? This works for me on .NET 3.5: using System; using System.Xml; public class Program { public static void Main() { try …

Member Avatar for deceptikon
0
97
Member Avatar for tofumaker

> can you please explain what was the cause of error in original code. Try reading the original post. It includes a description of the problem: *"I know whats wrong though, array is merely pointing to buf, it isnt copying the data from buf, so when the data from buf …

Member Avatar for deceptikon
0
159
Member Avatar for raavn111

It's somewhat amusing how you managed to pick the two worst possible options. gets() is completely unsafe, and the latest C standard actually *removed* it from the library. scanf()'s "%s" specifier without a field width is no better than gets(). In both cases input longer than the memory can hold …

Member Avatar for deceptikon
-1
139
Member Avatar for wolfmanemil

> don't even really know Assembly but I think you should ask a question in your post, not just post random code. It's especially important with assembly because the function of a program tends to be non-obvious. I doubt most of us will know what Lab_Tutorial_1 is, after all. ;)

Member Avatar for deceptikon
0
258
Member Avatar for ace8957

> Can you please explain how your hash funcion works? The use of the numbers and letter to add to the value a. It's an integer hash described in detail [here](http://burtleburtle.net/bob/hash/integer.html). But beware, the design of hash functions is a very deep hole.

Member Avatar for deceptikon
0
4K
Member Avatar for fugnut

> I know the OP did this YEARS ago, but here's how the function should look for anyone who wants to do this: Since we're talking about other people who want to do this, a table lookup is the recommended solution: #include <exception> #include <iostream> #include <stdexcept> inline int is_leap(int …

Member Avatar for deceptikon
0
3K
Member Avatar for WDrago

> Or should I do this (seems overkill): You should do that. It may seem like overkill to you now, but a using statement (implicitly calls Dispose()) will flush the streams, close them, and dispose of any internally allocated resources. To do it manually would require calling Dispose() manually, which …

Member Avatar for WDrago
0
243
Member Avatar for shukla ronak

Get Turbo C, install it, create a project, and write the code for it. Do you seriously think your question is meaningful?

Member Avatar for Schol-R-LEA
-2
127
Member Avatar for rexdon

> Give me an example for Serialising Multidimensional array in c sharp. That's an easy one: you can't do it. Multidimensional array serialization to XML isn't supported by .NET. You'll need to use a different type such as an array of arrays or nested List<>. But once you do that, …

Member Avatar for deceptikon
0
999
Member Avatar for qqaa007

> sqrt : DOMAIN ERROR > pie = + NAN > what does this mean? It means sum is negative, most likely.

Member Avatar for qqaa007
0
267
Member Avatar for ram619

You only allocated memory for p4. p3, p2, and p1 are all still uninitialized.

Member Avatar for ram619
0
131
Member Avatar for Elixir42

Everytime you say `new`, there should be a corresponding `delete`. Or better yet, you should use smart pointers to save yourself the trouble of figuring out when and where to release memory or worry about forgetting to do it.

Member Avatar for Elixir42
0
258
Member Avatar for ferdie.dumdumaya.33

> if usrnme is wrong and pass is correct, it will say "intruder alert" If the user name is wrong, how do you know the password is correct? Systems that allow only one user are dumb. Telling intruders that they're using the correct password and only need to figure out …

Member Avatar for deceptikon
0
87
Member Avatar for Fredszky

When you get extraneous garbage on a string, the problem is consistently a failure to terminate the string with '\0'. I didn't really look closely at your code, but I'm fairly confident that's the problem, so it should give you a starting point for troubleshooting. Just make sure that every …

Member Avatar for nmaillet
0
235
Member Avatar for Reverend Jim

> as long as the new posts are relevant to the topic. The susggestion takes that into account. We still have issues with people resurrecting threads with new or unrelated questions, or with posts that have no value (eg. "Thanks for sharing!" posts). I wouldn't be surprised if a more …

Member Avatar for Reverend Jim
3
283
Member Avatar for AndyPants

Since you're trying to keep things "clean" (whatever that's supposed to mean here), I'm guessing installing both is unacceptable. I'd suggest that unless you're using some feature in the 2008 version that isn't available in the free Express version, go with the more recent of the two.

Member Avatar for Ancient Dragon
0
114
Member Avatar for OsamaJutt

> but it creat error in the above line "<<list1" Are we supposed to telepathically extract the error from your mind? > friend ostream& operator<<(ostream& out, T theList); This looks odd (T here should be the type of the class), but I'm not confident saying for sure since you provided …

Member Avatar for OsamaJutt
0
134
Member Avatar for kyupa.suria
Member Avatar for kyupa.suria
0
210
Member Avatar for saurabh.mehta.33234

> I want to know that since the sizeof is compile time operator then why does thee above code outputs 4 even though the call to foo() will be made at runtime. You'll notice that foo() *isn't* called when used as an operand to sizeof: #include <stdio.h> int foo() { …

Member Avatar for deceptikon
0
397
Member Avatar for learner01

> yeah but i have very short time to submit it so i ask like that :) Last I checked, that wasn't a viable excuse for cheating. Please read our rules. When posting homework questions, we *require* proof of effort before you'll be offered any help. So even though you're …

Member Avatar for learner01
-3
250
Member Avatar for mayankjain05_1

scanf("%d", &t); And scanf("%d%d", &x[q][0], &x[q][1]); Notice the ampersand (address-of operator). scanf() requires a pointer to an object, and you were passing some random number which was extremely unlikely to be a valid address in your address space.

Member Avatar for mayankjain05_1
0
244
Member Avatar for lewashby

Technically all you need is the compiler and a text editor. In fact, it's usually recommended that you get comfortable doing everything from the command line before moving to an IDE because the IDE, while more productive, tends to hide things from you.

Member Avatar for deceptikon
0
175
Member Avatar for deceptikon

Another quickie. This is a basic class for working with Windows path strings. It's based off of .NET's System.IO.Path class, but doesn't contain any API dependencies (and thus doesn't normalize the paths, it's all straight string handling). Methods that I've personally found to be useful are included. The class is …

Member Avatar for deceptikon
0
401
Member Avatar for dreday92

By using the at() member function, out of range indices will throw std::out_of_range. So I'd wager `i` is out of range for the `reservations` vector given that `i` is bound to the size of the `user` vector. Though you've also got some fun looking scope hiding going on with `i` …

Member Avatar for deceptikon
0
753
Member Avatar for TrustyTony

The Legacy Languages forum doesn't have a specific language parser, so what you see is default coloration, and the quote operator is being parsed as a string rather than the Scheme quote operator. Obviously you can fix it by being explicit with `(quote [...])` instead of `'[...]`. Unfortunately, introspectively looking …

Member Avatar for TrustyTony
0
232
Member Avatar for P3C1

Why so many levels of indirection? The top two clearly aren't necessary within this program, so you could just do this: int **p = new int*[rows]; for (int i = 0; i < rows; i++) p[i] = new int[columns];

Member Avatar for P3C1
1
141
Member Avatar for letterG

What's wrong here: while(temp!=NULL){[...]} temp=add; If temp is NULL after the loop then it no longer refers to the tree in any way. So assigning add to temp will accomplish absolutely nothing when insert() returns. This was actually a stumbling block for me when I first started learning referential data …

Member Avatar for letterG
0
164
Member Avatar for napninjanx

> A great many programmers do not know what a compiler or a linker is either. Maybe I'm just an optimist, but I'd challenge that statement with the caveat that "programmer" refers to someone who has seriously attempted to learn programming and isn't a rank beginner. I find it difficult …

Member Avatar for Moschops
0
2K
Member Avatar for lewashby

Have you tried: s = '0' + s; That's assuming you're using a std::string object. For C-style strings I'd recommend not using them because it makes just about everything harder.

Member Avatar for Moschops
0
154
Member Avatar for abbashadwan

> I think it was 30 years ago, before the first c++ standards. C++ never supported void main() officially, even at the time of C with Classes. That was always a compiler extension, just as it is now. >> I think the standard says that main() will return 0 automatically. …

Member Avatar for Ancient Dragon
0
232
Member Avatar for nitin1

`sizeof` is meaningless for strings. At best you'll get the size of an array, which may or may not correspond to the length of a string contained within that array. At worst you'll get the size of a pointer or the size of the containing object (eg. std::string), neither of …

Member Avatar for Lucaci Andrew
0
211
Member Avatar for subith86

> As I am completely a newbie in this I want to know where to start. I'd start by figuring out how a website might be blocked, regardless of which browser makes the request. > Please provide me with any useful links which can help me. [This link](http://www.google.com) is probably …

Member Avatar for deceptikon
0
124
Member Avatar for VijayaDurga

> ya k tinstaafi i am the new one to dot net plat form , i dont know exactly what is what thats why i am asking again clearly If you don't read the links, which have far more extensive information than a post here would contain, what makes you …

Member Avatar for deceptikon
0
140
Member Avatar for NoCodeMonkey

I imagine it would be a good job for experience as you're likely to be doing most of the grunt work.

Member Avatar for code739
0
299
Member Avatar for pinkesh25gar

> want to convert this program into c language :( And it only took three posts to get to the root of the problem. :rolleyes: Anyway, you need to recognize that C doesn't have a dynamic array library like C++'s std::vector. So you really have three options: 1. Find a …

Member Avatar for Ancient Dragon
0
273
Member Avatar for shanki himanshu

> @moschops i am trying to avoid that loop. thats why i am using memset which fails. What do you think memset() does? Internally it's just a loop. There might be some unrolling involved or it might be written in assembly to speed things up, but it's still a loop. …

Member Avatar for Tumlee
0
548
Member Avatar for E.RANJANI

If you're too lazy to figure out what project you want to do, the project will be stillborn because you're clearly too lazy to actually *do* the project.

Member Avatar for tux4life
0
57
Member Avatar for nathanpacker

What's `musorv_uzi`? If it's a variable then you probably intended to say `$arr222[$musorv_uzi]`. If it's a string, you need to quote it. Presumably it could be a constant as well, but it's clearly not defined in the current scope.

Member Avatar for deceptikon
0
2K
Member Avatar for king03

Are you asking about mov in general, or are you asking specifically about moving the low order byte of a register?

Member Avatar for deceptikon
0
67
Member Avatar for elrond

If it's not working, have you considered fixing it instead of asking for something completely different? Or is it that you stole that code from somewhere and aren't capable of fixing it? I can tell you right now that `(a[i])^3` is meaningless because ^ is a bitwise XOR operator, not …

Member Avatar for elrond
0
261

The End.