3,183 Posted Topics

Member Avatar for cortiknee

> at link is showed input/output of function but no pseudocode to implementation .-. useless... And in *this thread* (the 4th post, to be precise) is a full working implementation. Hmm... > also find some code for ftoa() but there is some bugs or what... ftoa() is a significantly more …

Member Avatar for dverex
2
15K
Member Avatar for riccardo-m

> instead of all that shifting I just store it in a char array then xmit the array This introduces a portability issue that doesn't exist with shifting (ie. byte order), though whether that matters to the OP hasn't been established.

Member Avatar for riccardo-m
0
3K
Member Avatar for chandrasekhar p

> how to run the c program on note pad shall any one give me answer You don't run a C program from notepad. Notepad is a text editor and nothing more. What you need to do is write your code with a text editor, then compile it using a …

Member Avatar for deceptikon
0
191
Member Avatar for I_m_rude

Some compilers will add a pragma that allows you to do this, usually with the name "pack". Here's one for [Visual Studio](http://msdn.microsoft.com/en-us/library/2e70t5y1(v=vs.80).aspx) and one for [GCC](http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html).

Member Avatar for I_m_rude
1
89
Member Avatar for I_m_rude

> After his posts, see nobody is replying in this post, not even npcomplete who was helping me a little bit. After np_complete's posts, you appear to have done nothing except ask for more hints. Why should others try to help you when you clearly ignored the one who did? …

Member Avatar for I_m_rude
0
279
Member Avatar for rtyui

> Can't we assign the value returned by asctime() to a string? You can, but asctime() uses an internal buffer for the string, so it would be wise to make sure that a copy is made: #include <cstring> #include <ctime> #include <iostream> #include <string> using namespace std; int main() { …

Member Avatar for deceptikon
0
383
Member Avatar for nithyananthanaiker

> For now, my lecturer gave me an idea to improve existing OCR by creating some machine learning languages to improve the accuracy of OCR tools. This however is on dual mode where both 'research/development' is involved. Were you under the impression that computer science research *didn't* involve some development? …

Member Avatar for nithyananthanaiker
0
217
Member Avatar for Mahkoe

I'm not entirely sure what you're asking, but it sounds like you're questioning how malloc() works. In fact, it requests free memory from the operating system. Assuming the OS grants that request, malloc() now owns the memory and can do what it wants. Likewise, if malloc() succeeds then your program …

Member Avatar for WaltP
0
240
Member Avatar for andigirlsc

You have a `cin >> yearsLived` between the two getline() calls, which means the second call succeeds immediately on the newline left in the stream by the intervening formatted input. It's basically the problem described [here](http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream).

Member Avatar for deceptikon
0
389
Member Avatar for ChilledGrease

This is a classic example of binary searching. The appropriate solution for your computer is to guess at half the range every time. So the guess is always half way between the previous guess and the end of the range. When the guess is lower, set the bottom of the …

Member Avatar for Suzie999
0
290
Member Avatar for nitishok

I'll give you a hint: check your array indices where the element is being set to 0. You're overrunning one of your arrays and count happens to be at that address.

Member Avatar for deceptikon
0
168
Member Avatar for nikhil.pro
Re: hi

I have a better idea. How about you cut out all of the extraneous crap from your program such that only the absolute bare bones code is needed to illustrate the problem you're having and the question you want answered. Then post the code directly. Since you want to attach …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Swati_1

`i` isn't 0, so the first part of the logical AND succeeds. `i` is then incremented. Next `j` isn't 0, so the second part of the logical AND succeeds. `j` is incremented. The OR part of the test isn't performed due to short circuiting and `m` is set to a …

Member Avatar for deceptikon
0
61
Member Avatar for LD Company

> Can someone help me with simple code? I made software and I want to add option that can change languages. Yeah, that's *not* simple. Internationalization and localization are rather difficult, especially if you want to support widely variant languages like English and Arabic. Give [this resource](http://msdn.microsoft.com/en-us/goglobal/bb688096.aspx) a look through …

Member Avatar for deceptikon
0
230
Member Avatar for bashalarry

How do you become a good tennis player? By studying good tennis players, doing endless drills, and playing lots of tennis at a high enough level to give you a challenge. Programming is no different, though in my experience tennis drills don't really help the coding skills. Do you have …

Member Avatar for deceptikon
0
124
Member Avatar for 03Mach1

You should be using floating point variables if you need precision below 0, otherwise all of your weights are going to be 0.

Member Avatar for np complete
0
265
Member Avatar for revelator
Member Avatar for rocky2008

> Does the former mean incrementing the address of the pointer ? When pointers are involved there are four distinct values: 1. The address of the pointer object itself. 2. The value of the pointer, which happens to be an address. 3. The address of the pointed to object. 4. …

Member Avatar for deceptikon
0
201
Member Avatar for shanki himanshu

The 2 byte bit pattern of 512 is **0000 0010 0000 0000**. The 2 byte bit pattern of 514 is **0000 0010 0000 0010**. The one byte bit pattern of 2 is **0000 0010**. You do the math.

Member Avatar for I_m_rude
0
241
Member Avatar for ronnel09

You keep resetting iResult in the inner loop when it shouldn't be modified. This is correct: int iResult, iCount; for(iResult=0; iResult<=iRows; iResult++) { for(iCount=0; iCount<=iResult; iCount++) printf("*"); printf("\n"); } Also notice that I added braces around the outer loop. While you can omit the braces if the entire body of …

Member Avatar for deceptikon
0
132
Member Avatar for silvercats

> the more declarations ,the more momory it takes in RAM?? The usual situation is that each process is given a certain amount of stack space that the program can use for things like local variables and function call frames. Assuming those integers are stack objects then they'd be rolled …

Member Avatar for silvercats
0
162
Member Avatar for rahul pareek

Assuming that `ptr` is a pointer to a function, there's no difference. There are only two things you can do with a function: take its address and call it. Because of this limited operation set, the compiler can guess what you want to do from the context. If you're not …

Member Avatar for deceptikon
0
81
Member Avatar for samohtvii

The first warning tells you that isNULL is a pointer yet you're using it like it's not. This suggests a bug wherein you forgot to dereference the pointer. You're also using strcmp() incorrectly; it returns a comparison result rather than a boolean, where 0 means equality: if (strcmp(data, "NULL") == …

Member Avatar for deceptikon
0
273
Member Avatar for myk45

I wouldn't use bool for a bitset of error flags, but that approach isn't bad. In fact, iostream implementations will typically use it for the error state of a stream. What kind of errors are these? Have you considered exceptions?

Member Avatar for myk45
0
206
Member Avatar for montjoile

> so anyway no option to get stream from the keyboard? No portable option. There are non-portable options, but we kind of have to know what OS and compiler are being targeted before any viable options can be suggested.

Member Avatar for montjoile
0
464
Member Avatar for I_m_rude

http://www.ics.uci.edu/~eppstein/161/960109.html That should help you boil it down to the task of handling matrix multiplication.

Member Avatar for deceptikon
1
230
Member Avatar for fRodzet
Member Avatar for MasterHacker110

It wouldn't work without an emulation layer or cross compiling with a Windows target. The format of object code files is different between Linux and Windows.

Member Avatar for deceptikon
0
182
Member Avatar for Reverend Jim

I'm also unable to reproduce the problem. I hate intermittent issues, they're so hard to troubleshoot. :(

Member Avatar for Mike Askew
0
267
Member Avatar for samohtvii

> Can C pass by reference? No, but you can fake it with pointers. > Is there something about structs C doesn't like because everywhere my sruct is used it gives an error. C requires that structure names be qualified with the struct keyword. So while you can do this …

Member Avatar for deceptikon
0
306
Member Avatar for PinoyDev

It's pretty easy, if a tad obscure for those unfamiliar with locales in C++: #include <iomanip> #include <iostream> #include <locale> using namespace std; int main() { struct group_facet: public std::numpunct<char> { protected: string do_grouping() const { return "\003"; } }; cout.imbue(locale(cout.getloc(), new group_facet)); cout << fixed << setprecision(2) << 10000.00 …

Member Avatar for deceptikon
0
1K
Member Avatar for calculuskatie

> I have made it through only part a. Then please post the code to prove you've done it. Our rules clearly state that we require proof of effort on homework. > b) allow user to print array in ascending or descending order. I imagine either you've learned about bubble …

Member Avatar for stultuske
0
180
Member Avatar for ncis_sg1

> If I were to implement this into the code I already have where would I put it? It's a replacement for your code. > Will your code work for asking the user to input the .txt file of their choosing? No, you'd need to add that part. Though it …

Member Avatar for ncis_sg1
2
2K
Member Avatar for mekanike08

Please don't just post your homework assignment in the expectation that someone will do it for you. We require proof of effort, and then provide *help*, not free solutions for lazy people.

Member Avatar for deceptikon
-3
51
Member Avatar for TheLegend91

I'm guessing this is for an [arbitrary precision math solution](http://lmgtfy.com/?q=C%2B%2B+arbitrary+precision+arithmetic)? If so, have you don't any research at all? Do you have a rough idea of how you want the "system" to work? And by how you want it to work, I mean more than the vague concept of "using" …

Member Avatar for TheLegend91
0
246
Member Avatar for Десислава

TextChanged fires every time the value in the text box changes, so if you don't want to have a message box each time you press a key, you probably want to use something like a Leave or Validating event rather than TextChanged.

Member Avatar for deceptikon
0
82
Member Avatar for Manojpandey96

> You cant just use gotoxy(num, anothernum); and increment or decrement them in the for(int i) loop?? What if gotoxy() isn't supported by the compiler?

Member Avatar for deceptikon
-1
101
Member Avatar for I_m_rude

> What is this code trying to so ? It's trying to create a simulated 2D array without calling malloc() for each row but still allow array indexing for both dimension. Let's say you want a 2D array, but the size must be a runtime value. malloc() is essentially your …

Member Avatar for deceptikon
0
147
Member Avatar for jigar23

> I am not getting the reason for this error and how to rectify it. A segmentation fault is when you try to access memory outside of your address space. It's nearly always caused by dereferencing an invalid pointer address or using an out of range index for an array. …

Member Avatar for deceptikon
0
168
Member Avatar for muhammads

> Will i have two executables. Each for an environment? Yes. Technically you could write an app for one environment and rely on emulation like Wine for running on the other environment, but if you want native support then there will be two executables. > Do i have to write …

Member Avatar for rubberman
0
206
Member Avatar for billionair

> Does the number of functions in a program affect performance? It can. There's a certain measure of overhead in calling a function at runtime. > Is writing a lot of functions in a program a good practice? Not if there's no reason for writing "a lot" of functions. Programs …

Member Avatar for rubberman
0
166
Member Avatar for Gaiety

> i would like to know is there any advantange or necessity for having loops in a linked lists. Well, a circular linked list is itself a loop, and they're quite useful. Internal cycles strike me more as a bug or faulty logic (hence the need for detection algorithms), but …

Member Avatar for rubberman
0
176
Member Avatar for Lindsey1211

Your output would be correct if you printed `sec` as the number of seconds instead of `RemainderOfSeconds`. `RemainderOfSeconds` isn't meaningful anyway because you throw away the difference between hours and minutes. Using your example numbers, what is `20000 % (5 + 33)` supposed to represent?

Member Avatar for Lindsey1211
0
126
Member Avatar for constantinos21

Our rules clearly state: *"**Do** provide evidence of having done some work yourself if posting questions from school or work assignments"*.

Member Avatar for np complete
0
74
Member Avatar for YasaminKh

It seems like a better solution would be to edit the C++ code to accept input and output file names from the calling process, or run the whole thing in a loop a requested number of times from the calling process.

Member Avatar for deceptikon
0
120
Member Avatar for vaultdweller123
Member Avatar for PrimePackster
0
190
Member Avatar for tougheart

It really depends on what you enjoy, but if you're just trying to get into programming as a career then it would be wise to take what you can get and use that to build up experience. Once you have a little more experience you can make educated choices as …

Member Avatar for chrishea
0
233
Member Avatar for Dani

At least we're closer to completion of this feature, if the read status is only inaccurate from the homepage but works from forums and categories. I'll be doing training next week, but will definitely make some time to look into this (hopefully!) final piece.

Member Avatar for Dani
1
226
Member Avatar for qwazy

> Im pretty confused over bool functions too. They're functions that return a boolean value. Really not that different from a void function except for the return value. > Apparently the program runs through the bool enqueue function twice. If array size is 0, the next positive input will cause …

Member Avatar for qwazy
0
2K
Member Avatar for bigzos

> Why is the code not swapping names?? Because you're not swapping names. You're not even swapping Students. You're swapping local references (copies of references that are passed to swap()), which ultimately doesn't change the original references.

Member Avatar for deceptikon
0
80

The End.