-
Replied To a Post in System.IO.File.Move(fileName, destinationFile) "File in Use"
> Is this issued happening because I have "fileName" still open as "objReader"? Yes. > If this is the case, is there a way to close it while still in … -
Replied To a Post in Problem with array of n pointer to char
> word= (char *)malloc(sizeof(char)*100); `word` is a completely separate and independent entity from `words[i]`. Essentially what you're doing here is creating a new pointer, allocating memory to it, then throwing … -
Replied To a Post in Netbeans C++ declare an object of a class
Yay, my crystal ball still works. :) > By the way, in the future, I am to use a namespace instead, how do I do it? It's super easy. You … -
Replied To a Post in Array Copy Every Nth Element
True. The loop would be cleaner and more intuitive, off the top of my head. -
Replied To a Post in Array Copy Every Nth Element
A loop is simple enough, but you can LINQize it fairly easily: var everyNth = src.Where((x, i) => i % n == 0); That gives you the elements, and copying … -
Replied To a Post in Netbeans C++ declare an object of a class
Coolio. Actually, `clock` is a horrid name because it's also the name of a function in the C library. Your implementation could very easily expose that even if you don't … -
Replied To a Post in Netbeans C++ declare an object of a class
> If that helps. Not really. What *would* help is paring down your code to the absolute minimum without eliminating the error and posting it here so we can see … -
Replied To a Post in Netbeans C++ Random number generator
> I would go so far as to say never use rand() Unless you wrote it, of course. ;) I'm at the point with my C standard library that I … -
Replied To a Post in Netbeans C++ Random number generator
> Why is this so? `rand` is always seeded with 1 by default, so unless you change the seed with `srand`, the sequence will be consistent. -
Replied To a Post in Blocking DLL
> So yes, you can determine what the original source code looks like if there is no obfuscation/cryption. For .NET to a certain extent. It won't match the original source … -
Replied To a Post in error C2062: type 'float' unexpected
> `total += float read_input( a,b , c ,d,e );` The syntax is wrong for this line. First, the `float` keyword is unnecessary (perhaps you meant it to be a … -
Replied To a Post in expressions
> then the type of the expression is The longest, floatiest type. -
Replied To a Post in Is it possible to start Computer without any RAM?
> Obviously, the computer could not operate. Given the usual architecture, yes. But it's not inherently required for RAM to be present, otherwise paging into virtual memory wouldn't be a … -
Replied To a Post in Upgrade? Not so much!
> So much for my theory that avatar and usernames reflect people's personality! I have no idea what you're talking about. Mine is a perfect match for my personality. :D -
Replied To a Post in for loop vs foreach c#
> In this case the first is more readable and easier to code right? If all you need is read-only context, sure. Two cases where it's not easier is when … -
Replied To a Post in Would Love To See Old DaniWeb
Screenies of old Daniweb isn't half as interesting as the code for old Daniweb. Eew. ;) -
Replied To a Post in Where'd the pending article go?
At the very bottom of every page are lists of links, which include the article workshop that's filtered based on your user permissions. -
Replied To a Post in Stopping StreamReader to Delete the File
You can't (easily) delete the file while it's locked for reading, so I'd alter the logic so that you break out of the reading loop, destroy the reader object, *then* … -
Replied To a Post in Best sort for a doubly linked list
> Linked lists are elegant, but inefficient to keep sorted. Not if you use a hybrid tree/list, hash/list or a skiplist. :D But those implementations aren't as blindingly simple as … -
Replied To a Post in Wisdom Teeth
> Just got a jab in my gum to numb it, and the dentist yanked it out. I had to go down and have all four cut out since they … -
Replied To a Post in Unsolved program on pattern.
> PLEASE HELP AS SOON AS POSSIBLE. Please read our [rules](https://www.daniweb.com/community/rules) as soon as possible. Thanks. -
Replied To a Post in Binary Tree Code Help
> when one left side and one right side child complete then system credit 700 to parent id I don't understand your question. Do you mean when a node has … -
Replied To a Post in string in c
This is C, there's no magic. So you'll need to acquire the size of each string somehow or make an assumption of the most reasonable largest string. I used the … -
Edited string in c
I want to scanf array of string in c char *bookName[n]; for(i = 0 ; i < n ; i++){ scanf("%s" , bookName[i]); } but it dose not work ,what … -
Replied To a Post in string in c
You have an array of pointers to random memory, not an array of pointers to infinite memory usable by your program. This code practically begs for segmentation faults due to … -
Replied To a Post in deceptikon C webcast
> Not sure about the live Q&A part, it could be hard to gather a sufficient audience for that Well, more like a video demonstration allowing topical questions that I … -
Replied To a Post in C++
> You must declare int main() and return a value at the end. Yes to the first part, no to the second. If there's not a return statement in main, … -
Replied To a Post in Hello guys can anyone solve this exercise ?
> thanks guys u lost the chalnge Believe it or not, we can tell the difference between a legitimate challenge, and a lazy student trying to trick others into doing … -
Replied To a Post in Better than Split()?
> Actually this should probably be moved to snippets Done. :) -
Edited Better than Split()?
So I was recently working on a string program where the strings were easily megabytes long, and I ran into problems with there being out of memory exceptions etc. So … -
Edited About arrays
I need help with the question ASAP please here's the question Write a C program to create and manipulate a one dimensional array (list) of up to a hundred sorted … -
Edited filter within result set
I currently have a search form on one page that will look up various restaurants within city limits. Once submitted, you will be directed to a second page with the … -
Replied To a Post in Design issue in C#
> So whenever possible and performance is not an issue you would advise this sort of programming practice? I wouldn't say *whenever* possible. Clarity trumps, so if duplicating code makes … -
Replied To a Post in wojciech discussion
> Hmm, I guess I should have added the 'sarcastic smiley face' when I did that. Not to diminish the qualities of the forum though, it seems very well designed. … -
Replied To a Post in Design issue in C#
I'm a little biased as this kind of thing is something I use liberally to avoid duplication, but it's also a good practice in general. One thing to note though … -
Replied To a Post in wojciech discussion
> I have a feeling that WojTroll will go quiet now... Or create another account in the hope that we won't be able to tell (which we most certainly will). -
Replied To a Post in wojciech discussion
Ooh, forum drama. *grabs popcorn* -
Replied To a Post in Please explain this error
> I know the reason And you're correct. > Can you tell how to implement it without using global variable (I always try to avoid sharing variables), sting library, and … -
Replied To a Post in Please explain this error
You need to initialize the pointer to somewhere real, somewhere you actually own: #include <stdio.h> #include <stdlib.h> int main() { char* ptr = malloc(6); int i; *(ptr + 0) = … -
Replied To a Post in Please explain this error
Your pointer is null. Any attempt to dereference it invokes undefined behavior. The second snippet running okay is merely bad luck because it suggests that the code isn't glaringly broken. -
Replied To a Post in Lazy Questions
> I guess most native English speaking people will notice that English is not my main language If I didn't know, I wouldn't have guessed. Believe it or not, the … -
Replied To a Post in What's wrong with my goto statement??
> However, such cases are few and far between. Yes. I'm not advocating `goto`, simply adding some perspective. ;) > The goto statement is very powerful I agree and disagree … -
Replied To a Post in Lazy Questions
Laziness is certainly an issue, and sadly there's nothing we can really do about it without instating draconian policies. Another common reason for vague or poorly worded questions is non-native … -
Replied To a Post in What should I do ??
`gotoxy` let's you move unconditionally, but with standard output you need to print whitespace: #include <iomanip> #include <iostream> #include <string> using namespace std; int main() { int n = 15; … -
Replied To a Post in What's wrong with my goto statement??
> he told me that most of the good programs does not use goto statement That's not necessarily true. There's a lot of (well deserved) hate for `goto`, but it's … -
Replied To a Post in C++
Once again, please ask a specific question if you want a specific answer. Managing code seems pretty specific to me, so that shouldn't be a problem for you. -
Replied To a Post in Can you help me guys ??
> I think that bothers you looking at my program. Not really, it's a minor thing. The other problem is very significant. -
Replied To a Post in convert code VBA to VB.NET
> Congratulations! You're no longer a DaniWeb newbie.<br /> <br /> Why do people feel the need to post the contents of this notification? I'm genuinely curious. -
Replied To a Post in Can you help me guys ??
I see two problems immediately: char* names; This represents an uninitialized pointer, not a pointer to infinite available character slots as you're using it. I'd strongly recommend using the `std::string` … -
Replied To a Post in how to use structure in C
> the console I/O library is not a standard part of C, and is associated with older (that is, pre-C99) Borland compilers. Some common modern compilers support it. I don't …
The End.