3,183 Posted Topics
Re: That part of the post doesn't refresh through AJAX, so you'll need to refresh the whole page to see the code highlighting after submitting. | |
Re: Include <climits> for PATH_MAX,and MAXPATHLEN is in <sys/param.h>. | |
Re: In case 1 n is uninitialized, so you're printing whatever random garbage was at that memory location. In case 2 n *is* initialized, but once again foo() doesn't change it, so the value remains 4. In case 3, fooWithRef() *does* change the value of n, so you get the new … | |
Re: > how does fprintf() get know - when the list of parameters is ended ? It relies on the format string for this information. That's why nothing bad happens if you provide more arguments than the format string uses, but it's undefined behavior if you provide fewer. | |
Re: #include <iostream> using namespace std; #define PATTERN "-" #define SEPARATOR " " int main() { int row,col,n; cout<<"Enter an Integer number:\n"; cin>> n; cout<<("Numerical Pattern\n"); for ( row = 1 ; row <=n ; row++ ) { for ( col=1; col <= row ; col++ ) { if(col==row) { cout<< … | |
Re: > In other words are there instances where nodes are specifically needed to be sorted. Yes. Ordering of data is one of the most fundamental tasks. Whether you're using a linked list, an array, or a tree structure, some kind of ordering will be needed in the majority of cases. … | |
Re: I assume you're using a Linux system and not MinGW because MinGW's gcc supports getch(). You can reproduce the effect of getch() on Linux like [url=http://zobayer.blogspot.com/2010/12/getch-getche-in-gccg.html]this[/url]. ![]() | |
Re: There are two versions of iota: an old non-standard version and the standard version added with C++11. I assume you're trying to use the latter, in which case you need to both have a version of GCC that supports that particular part of C++11 *and* turn on the -std=c++0x switch. … | |
Re: > Is there a way to see the threads by last post first in the new system ? Not presently, but that wouldn't be a difficult feature to add. Can I get a rain check until we clear up some of the post-deployment hiccups? :) | |
Re: > Does try { } catch make program slower? No. There's a performance hit to actually *throwing* an exception, but if you don't catch it, it'll just propagate up and potentially be unhandled. In the case of exceptions you have no control over such as the standard or third party … | |
Re: I'm not sure I understand the difficulty. You already have the login credentials and know if they were legit or not, so it should be trivial to toss the user name into a label: labelLoggedIn.Text = _authenticated ? "Logged In As: " + userName : "Not Logged In"; | |
Re: > hey guys there is a problem with the input file and there is too many bugs........ Wow, that's just soooo informative. Can you elaborate about what the problem is? | |
Re: > newString.append("//");/*where I actually need doubleslashes */ Do the same thing twice: newString.append("////");/*where I actually need doubleslashes */ The double slash in string literals is an escaping measure because a single slash represents the starter for an escape character. Thus the escape character for a single slash is two: one … | |
Re: Unnecessary bumping is frowned upon because bumping sends the last post on page 1 to page 2 (which is tantamount to the kiss of death on Daniweb). But you're correct that there's no rule against it. Legitimate bumping that continues a discussion is fine, though it still annoys certain people. … | |
Re: I use Nettalk now that mIRC has tightened up their trial, and it works well for just chatting. | |
Re: This will match the first full line preceded by two newlines and a tab or at least four spaces: ((\n{2})(\t|\s{4,})(.*)) It's broken down into three capture groups: 1. `(\n{2})` finds the leading two newlines. 2. `(\t|\s{4,})` finds the leading tab or spaces. 3. `(.*)` finds the actual content of the … | |
Re: There problem is exactly as stated. `sequence` is a pointer to char (a dynamic array), so `sequence[i]` produces a single character, not a pointer to a character. I can't say how to fix it because I'm not sure what you're trying to accomplish with that line, but on the assumption … | |
![]() | Re: I just noticed this as well. Dani has been tweaking the editor and posting process, so something may have gotten through accidentally. I'll take a look. ![]() |
Re: > Can i start making money, even very little from this? Unlikely. Freelancers are expected to hit the ground running, and if you lack real world experience it'll be even harder finding a gig than a permanent junior position. Sure, you could bid on sites like rentacoder.com, but I wouldn't … | |
Re: You'd have to merge the source files manually and rebuild, but what's wrong with having two projects in the solution? You can reference one from the other (there's a `Projects` tab in the add reference dialog) if sharing is necessary. | |
Re: It's really just a customized trim algorithm. Search from the beginning until you find a valid character, then mark that position. Search from the end as well until you find a valid character and mark *that* position. Now you have enough information to extract a substring: #include <iostream> #include <string> … | |
Re: I've noticed that when pasting code, the editor doesn't maintain the tab level. This is probably a huge contributing factor in people's failure to correctly use code blocks under Markdown. Retaining the starting tab level would fix that particular problem...does CodeMirror support such an option? | |
Re: He probably wants you to be familiar with the core .NET framework, and at least one language tied to it, such as C# or VB.NET. | |
Re: Hmm, interesting. Two things to consider since there's some potential funkiness involved. When you call malloc(), make sure that the correct header is included, and also cast the result as C++ doesn't support implicit conversion *from* void*. This is all speculation since I haven't used a Borland compiler in ages, … | |
Re: Your job would be *vastly* simplified by storing the numbers in an array rather than as separate variables. Then you can sort the array and choose the median with ease. | |
Re: Your pointer to dynamic memory was corrupted somehow or was otherwise invalid. Usually this is the result of writing outside the boundaries of the requested memory because those areas are often used by the memory manager to store bookkeeping information, and thus they're very fragile. The following stands out as … | |
Re: A constructor may only called during a declaration (under normal circumstances), so your code should look like this if you want to reset the `dent_space1` string object: dent_space1 = std::string(max_space, ' '); Or since the object already exists: dent_space1.assign(max_space, ' '); | |
Re: > All admins, moderators, team colleages are employees or some of them just contribute their time to site. And if they are employees how do you work together? at one place? Any compensation is between the individual and Dani, but to the best of my knowledge the team is mostly … | |
Re: It's not standard Markdown, it's one of the forks with extensions: https://github.com/egil/php-markdown-extra-extended#readme. In particular, the ~~~ syntax is for fenced code blocks. | |
Re: > i need to display the numbers 1 to 9 randomly but they cannot be repeated! Then technically it's not random. ;) There are two ways to get a non-repeating set of random numbers: * Store the generated numbers and try again if you generate one that's already been generated. … | |
Re: In your shoes my struct definitions would probably look like this: struct Subject { char name[MAX_SUBJECT]; }; struct Node { struct Subject data; struct Node* prev; struct Node* next; }; struct Queue { struct Node* head; struct Node* tail; int size; } struct Student { int id; char first_name[MAX_FIRST]; char … | |
Geeks and conventions go hand in hand, right? ;) Who here plans to go to this year's Dragon*Con in Atlanta? | |
Re: It was your control panel in vBulletin. The new design is intentionally "plain" because it's only a first version of the system and a simpler design improves both performance and usability. The control panel from vBulletin in particular was excessively complicated and it confused people. Now that we're relatively stable … | |
Re: Probably a stupid question, but do you have Firefox set up to remember form data in your privacy options? | |
Re: > I think the main thing I'm not entirely sure of is how to "cut" the numeric format down and get the last two digits for the "secret message". Use division and remainder math: 19546 / 100 = 195 19546 % 100 = 46 It's easier to keep the numbers … | |
Re: I know this is for school, but a dedicated matrix object or vector of vectors would be much better in terms of usability and flexibility than a multidimensional array: #include <iomanip> #include <iostream> #include <vector> #include <cstdlib> #include <ctime> using namespace std; typedef vector<int> Row; typedef vector<Row> Matrix; Matrix matrixGenerator(int … | |
Re: > Am I the only one who feels this way? Nope. I'm giving the OP the benefit of the doubt though, because it's possible that this has legitimate uses. However there's a strong chance that it's a very naive attempt at virus propagation logic. > Also, wrong forum. Looks fine … | |
Re: I have a better challenge: prove that you're not just looking to trick other people into doing your homework for you or I'll find you in violation of Daniweb's rules and act accordingly. | |
Re: You neglected to specify what the problem you're having is, but I do have some notes on the code as it stands: > temp1 = (node*)malloc(sizeof(node)); // allocate space for node temp1 = head; You allocate space for a node, then immediately throw away your only reference to it. Not … | |
Re: The concatenation operator for std::string doesn't convert non-string (or character) types to strings. Try this instead: #include <iostream> #include <string> using namespace std; int main() { string s; for (int i=0; i<10000; i++) { s+="1"; for (int j=0; j<i; j++) {s+="0";} } cout << s; } | |
Re: > when the user input numbers, it should be arranged just like an actual tree If the tree is required to be displayed top-down then you're looking at some form of level order traversal to get the nodes in the proper order for display and a relatively non-trivial algorithm for … | |
Re: `near` and `far` were keywords used to modify pointers back when the segmented memory architecture was both used and transparent. Near pointers would access the current segment while far pointers could reach across segments. Compilers that supported such keywords probably still support them for backward compatibility, but on modern systems … | |
Re: Your functions represent two extremes: 1. Reading and writing character-by-character 2. Reading and writing whole files as a string You can get performance benefits without excessive memory usage by reading and writing the files in blocks. This is a happy medium from the two extremes, look into the read() and … | |
Re: Both are acceptable, but take note that this only applies to when both the declaration and definition are in the same file. Once you start modularizing your files, the accepted format is a header with the declarations, an implementation file, and one or more usage files: ## Header ## #ifndef … | |
Re: [QUOTE]In your honest opinion, employee, employer, etc., do you think it matters what college one obtains a degree in Information Technology from when it comes to high amounts of competition?[/QUOTE] Realistically, it can matter. Most of the time it only matters that you have a degree, and in IT related … | |
Re: With the given information one can only assume a truly random shuffle of a single list of tracks with no other variables involved, so the probability is 1/1000 every time a new track is selected. |
The End.