3,183 Posted Topics
Re: It sounds like you copied the executable itself rather than creating a shortcut. | |
Re: You're sorting and printing while building the array, which is not entirely incorrect, but unlikely to display properly. Finish reading the file, then sort and print; you'll get the correct result that way. Here's the corrected code with a few other changes: #include <stdio.h> #include <string.h> #include <stdlib.h> static void … | |
Re: It depends quite a bit on the contents of your file. Let's say that the file looks like this: resistor inductor capacitor diode transistor circuit Then you would replace your `push_back` calls with something like this: ifstream in("words.txt"); if (in) { string line; while (getline(in, line)) { words.push_back(line); } } … | |
Re: > how can I use it ?? A "dynamic array" is really nothing more than simulating an array. Once created, you use it very much like a regular array. > how can I allocate and intialize it ??? This will allocate a dynamic array of 10 pointers to `int`, then … | |
Re: Please read our [rules](https://www.daniweb.com/community/rules) concerning homework. | |
Re: Someone can help you when you ask a specific question. Daniweb isn't a "do my work for me" service. I do have one question though, given that VB6 is increasingly becoming unsupported on Windows (eg. runtime dependencies are no longer installed by default): Why are you using VB6 instead of … | |
Re: > Is it valid to use an integer variable as a condition? Yes. This: if (var) Is logically synonymous with this: if (var != 0) Provided `var` has an implicit conversion to an integer or boolean type, it's perfectly valid and makes for nice shorthand in some cases. In this … | |
Re: The reply editor also has helpful buttons that will do this for you. 1. Select your text and click either the Code or Inline Code button to apply formatting. 2. Click the Code button to open an editor popup where you can paste your code. Submitting that will insert into … | |
Re: > i suck because i had zero knowledge on Unix or Linux No, that's silly. Will learning other operating systems help round you out as a developer? Sure. Does your "goodness" as a programmer depend on knowing \*NIX platforms? Absolutely not. Let me put it this way. I'm primarily a … | |
Re: It rather depends on the type of the array. If it's anything but some variant of `char`, I'd recommend using a loop to avoid nasties by diddling with individual bytes of a multi-byte type. | |
Re: Off the top of my head, I might approach it two ways: 1. Simply have the application check periodically for new records. This would be the easiest to implement, but it may see derading performance over time. 2. Use a notification service that pushes new records to client applications so … | |
Re: The logic should be conditional. You're inverting the case based on the original case, not unconditionally changing it: for (int i = 0; input[i] != '\0'; i++) { if (isupper(input[i])) { input[i] = tolower(input[i]); } else if (islower(input[i])) { input[i] = toupper(input[i]); } } cout << input << '\n'; | |
Re: Sorry, but discussion of hacking is against Daniweb's rules. We can help you at a high level, but anything more detailed that could be used to create an exploit is prohibited. | |
Re: Do you mean what rules you *must* follow for a valid identifier, or guidelines for informative variable names? | |
Re: > The part I’m struggling with is getting the date out of the string which will work for different string lengths So here's my thought process as a professional (as if that adds weight to my comments...): 1. Is the date always in the same place (ie. at the end … | |
Re: Undefined behavior is unpredictable by definition. You could certainly figure out why it "works", but it would be specific to that version of that compiler. | |
![]() | Re: > Ok, so I tried to change my class properties as Pritaeas suggested, but this didn't work. It should work, but it's hard to tell why not without seeing a complete bare bones example that exhibits the problem. > Would this be an appriopriate use of (get;set;)? Yes. In fact, … ![]() |
Re: Yes, someone can help. What do you have so far? If you don't have anything, what's your thought process for working it out? Have you analyzed the structure of a sentence to break it down into words? Note that "help" does *not* constitute doing work for you. | |
Re: > Apologies if that led you down the road, not intentional. Careful there Davey, we might start thinking you're a disingeunous journalist who's into fearmongering. ;) Ernieway... > According to research commissioned by security vendor Bit9 + Carbon Black, nearly half (49%) of the organisations questioned admitted they simply didn't … | |
Re: God forbid you post interesting content that people will like. I guess that's too much work compared to artificially increasing likes with silly things such as sock puppet accounts. | |
Re: That's a pretty simple one. There's no definition of the _Clrscr function anywhere in the translation unit. Visual Studio doesn't come packaged with any form of clrscr as a "standard" library, so you need to consider the following: 1. Did you declare it somewhere but not define it? 2. Are … | |
Re: Normally I'd point out what's wrong, but in this case it's *very* instructive to work through what the code should be doing versus what it's actually doing on paper. Here's a working example you can use to compare with though. It's written in C, but a conversion to C++ is … | |
Re: The linked image is nonsensical. Please elaborate on your assignment. | |
Re: Ah pronuciation. T'was the bane of my existence (not really, just mildly annoying) with a previous account. | |
Re: > More control, you know you have exactly 1 line the are no extra characters interfering with your parsing of the data With the caveat that your second advantage interferes with the first. > You limit the amount of data read to your buffer size so there is no chance … | |
Re: Given a certain measure of development experience, simply seeing the behavior of a program can offer insight into the underlying logic as well. | |
Re: > The second method is obviously easier to read. Provided blocks are indented correctly and at a reasonable depth, the location of braces doesn't really matter...to a certain extent. I think you'll find that your preference varies over time. Right now you clearly prefer Allman bracing over K&R, but that … | |
Re: A segmentation fault typically means you tried to access memory outside of your address space. The most common causes of this are a bogus index or invalid pointer. Also note that the point at which an error manifests doesn't mean that exact line is the root cause. Sometimes the line … | |
| |
Re: > I'm a little confused about inlining member functions. It would help to understand how regular functions typically work. A single definition of the code is created, then calling code jumps into the definition to execute the function. Inlined functions have their bodies essentially pasted directly where the call is … | |
Re: > i think you can go to ios for developing application on i phone....and java/android for all leading smartphones... iOS isn't a language, it's a platform. Objective-C is the language that Apple has blessed for iOS development. At one point "third party languages" were disallowed, but that stance has changed. … | |
I work with images...a *lot*. Often this involves image processing of various types such as resizing, resampling, and various cleanup operations. However, a common issue is that people like to conflate Adobe PDF with images. As such, any application that works with images should also work with PDF. However, since … | |
Re: > Are any particular one which should be used at specific times? I favor the guideline that you should use `'\n'` unless you know that the stream must be flushed immediately and nothing else consistently does it for you. Times where you have a lone output statement and the stream … | |
Re: I'm not sure I understand the need for this restriction. Could you elaborate? | |
Re: > - my fingers are on "A", "W" and "D" keys Yup, I've got that one. Another is that I have a tendency to end sentences with a semicolon due to excessive coding in languages that use a semicolon as a statement terminator. ![]() | |
Re: Depending on your needs, it could be as simple as: if (Directory.Exists(path) || File.Exists(path)) { // Yuppers } But it's somewhat hard to answer your question because it's a little vague. What exactly constitutes "valid", for example? What kind of paths are you supporting? Is this a file path or … | |
Re: My primary concern would be what kind of pictures are you trying to display? A picture box control may not support them, in which case you need to find an alternative. As far as picking a random picture, that borders on trivial: var files = Directory.GetFiles(path, searchPattern); var imagePath = … | |
Re: > Internet recources on algorithms are suprisingly sparse, especially compared to "regular" programming. Ironically, my go-to quick reference for algorithms and data structures [is a website](http://xlinux.nist.gov/dads//). It's the most complete reference in a single location to the best of my knowledge, and tends to be recently updated. Not perfect, but … | |
Re: > why they put it ?? They're being explicit, I suppose. If a function returns `void`, there's no need to place a return at the end. Falling off the closing brace does it automagically. > what is the logical meaning of it ?? It means that the function will hand … | |
Re: Without looking at the specs, or knowing your needs, I've had good experiences with both brands (my current mobo is ASUS). To properly answer your question, I'd need more details. | |
Re: > it consists out of multiple files including *.vshost.*, I don't see such files in Word, Skype of Firefox The vshost files are specific to your installation of Visual Studio for debug and settings information, they're not included in a deployment package. > One gives a lot of knowledge of … | |
Re: A good start in determining what's wrong is asking what it's doing versus what you expect it to do. So...what's it doing that's different from what you expected? :) I see two problems in particular, one of which will be immediately obvious from the compiler's errors and the second will … | |
Re: Done. Show me your solution and I'll show you mine. | |
Re: Were I writing something like that, I'd link the web access and application access with a web service. * Web Service: WCF * Web Access: ASP.NET * Application: WinForms or WPF * Mobile: Whatever WSDL consumption API is available for the supported language. |
The End.