-
Replied To a Post in Hexagon window
Moved to code snippets. :) -
Edited Hexagon window
Yes, WPF. The learning curve is steep, but what amazing things you can do with it! Look at this hexagon window for instance. Serves no purpose in a business environment … -
Replied To a Post in How To Write To A File Using fstream In Windows Forms C++
While I'd start by suggesting that you use the .NET file stream options instead, String^ *can* be converted to std::string using marshal_as if so needed. -
Replied To a Post in randvar error
From the provided code, I can't offer more than int delete_list_entry(temp_head, randvar); should be delete_list_entry(temp_head, randvar); I get the impression there's a little confusion between how to declare/define functions and … -
Replied To a Post in Why mem function doesn't work inside c++ function?
`p` is a pointer to read-only memory. While some compilers might allow it to be modified, technically what you're doing is undefined behavior. Change line 6 to `char p[] = … -
Replied To a Post in Advices to become a better developer
> I’ve realized that I’m a little weak when it comes to fix, modify and understand code within large applications, and, needless to say, I need to find a way … -
Replied To a Post in How to read csv file contents in VB.Net
I'm surprised that nobody has even mentioned the TextFieldParser class in Microsoft.VisualBasic.FileIO... :P -
Replied To a Post in need help with this school project
Okay. -
Replied To a Post in ATM machine
What have you done so far? Nobody here will write this for you. -
Replied To a Post in Merchandising
I'm a bit surprised you haven't been walking around town handing them out as advertising. There were still a number of big boxes full of shirts after that night, IIRC. … -
Replied To a Post in Brainf**k
> Teaching Pascal as a first language in 2017? Really? Pascal has the benefit of being very easy to understand. It's also hand-holdey, which for most of us translates to … -
Replied To a Post in C code snippet
This is clearly a homework or interview question, so please let us know what your thoughts are first. -
Edited Pagination with While loop
Hello ladies and gents, i hope you are all well! Just recently joined this site looks great and easy to use. I am just getting into php and msql i … -
Replied To a Post in User Input Char Array?
> char array's are actually pointers This is a common misconception. An array is *not* a pointer, but when used in value context, the name of an array is converted … -
Replied To a Post in Is there a way to detect garbage value?
> is there any pattern to find out garbage value???????? The term "garbage" is meaningless without context. What's garbage for one program could be perfectly valid for another program. So … -
Replied To a Post in Bucket Sort
Most common domain applications, perhaps? Which examples are you referring to? Bucket sort is certainly not limited to that range, though I can imagine how it's wildly useful. -
Replied To a Post in how can I show data in a table in SQL server database to ASP.NET gridview
Step 1 of troubleshooting is narrowing down the places you need to look. With that in mind, my first question would be whether `dt` actually contains data or not when … -
Replied To a Post in Help with sum of Even or Odds Array
> zachattack05 : 25 % 2 would return 5 I'm so tempted to write a proof where this actually happens. :D -
Replied To a Post in Help with sum of Even or Odds Array
> ... or use bitwise operator `if(i&1)` if true even else odd. I suppose if you want readers of your code to think you're clever, or have legitimately profiled the … -
Replied To a Post in Empty path name is not legal
Well, assuming the title of your thread is the problem, I'd ask what `a.FileName` is and contains. An empty string is indeed not a legal file path, so you want … -
Replied To a Post in Type conversion from string to const char * problem
> Thus c_str() isn't making a copy of anything, globalPtr is pointing to the same array of characters that abc uses and if you make a change using globalPtr or … -
Replied To a Post in Getting garbage integer when printing out pointer array after addition
Let's start by fixing things so the code doesn't break massively from out of range errors: #include <iostream> #include <string> using namespace std; typedef int* intPtr; const int MAX = … -
Replied To a Post in Getting garbage integer when printing out pointer array after addition
> `while (*p != '\0' || *q != '\0')` This is a red flag. Your arrays are not constructed as C-style strings, so '\0' isn't likely to exist within your … -
Replied To a Post in Type conversion from string to const char * problem
> when fun() returns, it calls the copy constructor again, right? Ehh, kind of. Return value optimization is a thing, but conceptually it's okay to think of things that way … -
Replied To a Post in Type conversion from string to const char * problem
> Can you please explain the reason behind this? You're capturing a direct pointer to the internal storage of the string returned by fun(), which is a temporary object. The … -
Replied To a Post in Boilerplate for publishing code on Daniweb
> I know that Daniweb owns the I.P. No. That was unfortunate wording in previous terms of service, and the intention was to absolve Daniweb of legal responsibility for storing … -
Replied To a Post in My code runs fine but something along the middle goes wrong
I'd strongly recommend walking through your code with a debugger. And my big hint for the problem is that the Enter key places a character in the input stream: '\n'. … -
Replied To a Post in Short data type
> I know that the max value for short data type is 32767 Not necessarily. The C++ standard defines a minimum required range, but compilers are free to make it … -
Replied To a Post in How do I "ignore" this line from the input?
It's not necessary, but generally recommended for classes that implement IDisposable. -
Replied To a Post in How do I "ignore" this line from the input?
Well, for starters the "/* ... */" comment supports multi-line, so you'll need to consider that in your parsing. A simple approach would be a loop that reads and throws … -
Replied To a Post in C programme output
I'll make the obligatory comment that you should be using a modern compiler rather than trying to kludge a 30 year old compiler into your modern OS. That said, the … -
Replied To a Post in Find the minimum of a list with conditions
The first thing that comes to mind is to filter out the special value(s): `MyList.Where(x => !double.IsNaN(x)).Min()`. Though depending on what might be acceptable insertions into the list, you might … -
Replied To a Post in Yesterday's date using c++
The calculations are unnecessary. `mktime` can be used to normalize the contents of a `tm` structure to the correct date and time after manual modifications. #include <iostream> #include <ctime> using … -
Replied To a Post in functions containing for, while, switch are not expanded inline.
The `inline` keyword isn't a guarantee, it's a hint. If the compiler determines that inlining would produce worse code, it doesn't honor the hint. Some compilers just straight up reject … -
Replied To a Post in Turbo C/C++ Keyboard not working
You could try not running software that's older than most of the people using it... -
Replied To a Post in Whats the most efficient randomizer is in c++?
> What I DON'T understand is why srand(time(NULL)) and rand, which is what we're all taught to use, are such lousy random number generators Probably for the same reason `gets` … -
Replied To a Post in Code / Method generation Visual studio 2015
> You mean issues with different machine word size? Byte order would be a larger concern. In your case, I'd favor serializing to JSON for your packet. -
Replied To a Post in Code / Method generation Visual studio 2015
You still haven't mentioned the use case, so I can only speculate. However, it sounds very much like a binary serialization *isn't* what you want because there are compatiblity and … -
Replied To a Post in Code / Method generation Visual studio 2015
> I have a lot of classes I need to add a ToByteArray() method to What's the purpose of this method? Typically I'd suggest utilizing the serialization classes already present … -
Replied To a Post in C programming minor bug
I agree with AssertNull, it's very likely the newline character mucking things up. Your compiler (or compiler settings) probably aren't zeroing out local variables while AssertNull's is, which explains the … -
Replied To a Post in conio.h not recognize in c++
> so maybe you need to write cpp.sh is an online compiler that you can test your theory with. It takes a few seconds to confirm that this does not … -
Replied To a Post in Belated alert
> Just keep pressing the little X a bunch of times in a row until they are all cleared out. Yeah, clicking the X 300 times with a couple second … -
Replied To a Post in read the entire contents of a txt and store them in a single string
> As I recall you should use fseek and ftell to get the file size[...] That's fine for simple use cases, but it gets troublesome very quickly. For example, large … -
Replied To a Post in How to concatenate the characters read from a file with fgetc?
> to determine if it is a number, keyword or an identifier This is a key statement to me, because it sounds like you're writing a lexer. If that's the … -
Replied To a Post in I need help to write C# program for odd even number
Please start by posting your code and pointing out where exactly you're having a problem. -
Replied To a Post in Cell phones and cancer
> I had much more respect for his "comedy" news than I have for "real" news". When The Onion reports things and you can't tell the difference between them and … -
Replied To a Post in Why IPhone is more costlier than Andriod
> What is the exact reason that Iphone is more costlier than Andriod phone If we're being honest, the reason is the Apple logo. -
Replied To a Post in Removing downgrade option in Windows 10
The option to downgrade will go away on its own after one month, IIRC. -
Replied To a Post in help with code error
As rubberman mentioned, those typedefs are specified in `<stdint.h>` (for C) and `<cstdint>` (for C++). But note that `<cstdint>` wasn't officially supported by C++ until the C++11 standard, so if … -
Replied To a Post in Invalid Input
> But this does not work.If user input invalid value it start looping. Indeed. When `cin` fails to make a conversion, it doesn't remove the invalid characters from the stream. …
The End.