3,183 Posted Topics
Re: > but I have no idea what N0$ for example stands for It clearly stands for the digit '0' in morse code. The dollar sign is just a character in the label name, nothing more. You access it like any other label/variable/identifier. Which assembler are you using? | |
Re: > Quick survey, are you guys liking Visual Studio 2012? I've only seen a bit of it over the shoulder of a coworker who's playing with it. There seems to be a "dark" mode that I really like, and the interface is less busy, which is good. There are a … | |
Re: > Why is it safe to use delete[] without getting a crash or something? You consider undefined behavior "safe"? | |
Re: You need a line break between `#else` and `switch(nAbilityOption)`. | |
Re: > `for (i = 0; i < gsize_ptr; i++){` `gsize_ptr` is a pointer, you need to dereference it: for (i = 0; i < *gsize_ptr; i++){ Of course, looking at that function definition I see no reason why `gsize_ptr` needs to be a pointer in the first place, unless that's … | |
Re: It's totally easy. Take a look: #include <stdio.h> int main(void) { for (int i = 1; i <= 5; ++i) { for (int j = 1, x = 2 * i; j < x; ++j) printf("%.*s%d%s", j>1?0:2*(5-i),j>1?"":"\ ",j<=i?j:i-j%i,j<x-1?" ":"\n"); } } Mwahahahahaha! But seriously, you need a loop for the … | |
Re: I think this post should be submitted for the laziest leech student of the year award. How do you sleep at night? | |
Re: > maybe Discussion of virus implementation is prohibited on Daniweb. But yes, it's possible to physically harm hardware through software, if one is so inclined. > Also "Does the programmer have to control memory manually in Assembly ?" Yes, unless you call into a library that manages memory for you. | |
Re: Chances are pretty good that you won't be able to stop it from being delivered, but out of morbid curiosity, what delivery method are you using? Email, I assume? | |
Re: Yummy, I like it. There's a good selection of forums I'm likely to look in a session. While it's a minor thing, being able to mark the forums as read from there with a single click is nice (it's minor from the user perspective, of course. I'm still traumatized by … | |
Re: > It is wr,tten enough to solve it besides No, it's not. > besides, if you dont want to reply you dont so it is not neccessary for that replying ;-) Then you don't mind if I just close this thread as being in violation of Daniweb's homework rule? Okay, … | |
Re: > 1, all the times I have done a comparasin, > < == in the past there has been an else, in this their is none It's implicit. You can pretend it looks like this if you'd like: if (a+b > c+d) return func(a + b, c + d); else … | |
Re: It has nothing to do with the "array" and everything to do with the wacky use of pointers for smallest and secondSmall. Just make those regular float variables, there's no need for pointers there. | |
Re: > I dont know how to use pointers. That's your problem, and the fix is learn how to use pointers. But since you'll probably get mad if I don't offer an exact solution to your immediate problem, change this: t_matriu *Crea_M ( int dim ) To this: t_matriu Crea_M ( … | |
Re: I'd hold on to it. You never know when you might be asked to work on a legacy project that requires that version of Visual Studio. In fact, I have a copy of Visual Studio 6 both at home and at work precisely for that reason. I've benefitted greatly from … | |
Re: Tonari no Kaibutsu-kun and Suki-tte Ii na yo are all I need to call this season a home run. Today is a good day for otaku deceptikon-kun. :) | |
Re: > Actually what happens is we get error in realloc function written in gfunc_Realloc Function in line 174 As a proof of concept, replace realloc() with the corresponding free(), malloc(), and memcpy() process. I'm willing to bet the error you get is happening in free(), which means you've corrupted the … | |
Re: Given that the code was pinched verbatim from [this article](http://www.linuxforu.com/2009/02/a-voyage-to-the-kernel-day-8/), my initial question is why do you think it needs debugging in the first place? Does it not work? That's somewhat likely, but I'd like to believe the article's author wouldn't publish untested code. Or does it just do something … | |
Re: You could certainly do it that way, but it's excessively complicated. The pattern adjusts predictably for each row, so just keep it simple: #include <iomanip> #include <iostream> using namespace std; int main(void) { int distance = 7; int i = -1; while (++i < distance / 2) cout << setw(i) … | |
Re: Give it a try first. We require that you provide proof of effort on homework problems. | |
Re: > What does this error mean? It means you must declare something before you use it. Specifically, getMatrix() and displayMatrix() are defined (and declared) *after* main(), but you use them in main(). Add a prototype to declare each: void getMatrix(int number); void displayMatrix(int number); int main(void) { > More fundamentally, … | |
Re: > i have to do division without divison/multiplication/mod operator. Yet another dumb assignment that serves no purpose in reality. Can't educators think of more practical exercises? | |
Re: > assert( ! inStream.fail() ); // make sure file open was OK And if the file wasn't opened okay you'll hard stop the process with a cryptic error? Sounds like the pinnacle of user-friendliness. :rolleyes: assert() is intended to help the programmer debug impossible errors at development time; it's not … | |
Re: > Then read from the file and when you run into array boundaries expand it using realloc(). An alternative would be a two pass algorthm that counts the number of lines and maximum number of columns for the first pass, then allocates the array and populates it in the second … | |
Re: > that sounds good... any code exapmples? That's something you could (and should!) search for yourself, but I'll bite: #include <stdio.h> #include <string.h> int main(void) { char src[] = "This is a test"; /* Note that it's an array and not a pointer */ char *tok = strtok(src, " "); … | |
Re: The `switch` statement isn't well suited to ranges, and it also doesn't support floating point cases, so you're SOL in converting the grade calculating from an `if` chain to a `switch`. May I ask why you need to do this? Is it a requirement from your teacher? | |
Re: Let's start with the two most obvious bugs: 1. You compare two values with the == operator, not the = operator. The = operator is for assignment. 2. `if` statements and loops with more than one statement in the body *must* be wrapped in parentheses. It'd be a good idea … | |
Re: > Either get a new compiler (free) or forget about your program. You could queue up the keystrokes and process them in sequence. Provided they're processed quickly enough, the end result should be comparable to a threaded solution. It's not like games weren't written with Turbo C when it *wasn't* … | |
Re: Hardware typically comes with device drivers that provide an interface for system and user level applications to use the hardware. | |
Re: [Click me](http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx#delete). | |
Re: > character=getch means????? It means you need to realize that this isn't Twitter. You don't have a 140 character limit, so please engage your brain and try to communicate like an intelligent human being. You'll get much better answers if you ask comprehensible questions. kthxbye. | |
Re: So...what output does the program produce and how is that not what you want? | |
Re: > But still, I'm curious, why does (*this)[i] work? Because you're dereferencing the `this` pointer and then accessing the overloaded [] operator (which is technically a member function). While it may look the same as `a[i]` in your example, under the hood the two are very different. | |
Re: I can't decide which answer is most appropriate, so I'll provide both: 1. Do your own damn homework! 2. Please provide proof of effort and then ask a specific question if you want help with this problem. | |
Re: You can also select which language to compile as in the project properties: **Configuration Properties -> C/C++ -> Advanced -> Compile As**. | |
Re: You didn't check to see when A equals 120. The implicit check is against 0, so your loop actually looks like this: while (A++ != 0) { B += 10; } There are a number of things that can go wrong here, which you can limit a bit by changing … | |
Re: It's possible to bubble sort a linked list, but it's kind of dumb given the overhead of indexing a linked list *on top of* the weakness of bubble sort. | |
Re: Discussion of software development specific topics with a primary focus on helping both students and professionals with their specific problems. | |
Re: > The person either didnt want to do it I'd argue that if he didn't want to write such a simple program he's at a level where Gonbe's code would be easily recognizable as plagiarized by any teacher with more than two brain cells to rub together. That's assuming he's … | |
Re: Your format string is incorrect. The %s will read until the first whitespace, so a literal ':' won't be matched (since it was already extracted) and will cause the fscanf() call to fail. If you want to match it then this would be better (example using the first line): char … | |
![]() | Re: > I just wondered what might be your training routines. Post and share them here. This is my current routine: Mon: Upper body (bench press, rows, pull ups, biceps curls, triceps extensions) Tue: Lower body (leg press, leg curls, calf raises, back extensions, crunches) Wed: Rest Thu: Upper body (same … |
Re: > I was wondering is it at all possible to programatically select an area of an image to display? Of course. Though how you do so depends on what kind of processing you're doing. Sometimes a thumbnail will work, other times you can simply crop, still others might have you … | |
Re: > Ignore the above it would be an answer so it's evil and totally stupid of me to post. No offense, but this statement makes you seem childish and bitter. Surely you can tell the difference between explaining how const works and posting a complete working program for an obvious … | |
Re: What result are you trying to achieve here? | |
Re: > const int DELAY_IN_MICROSECONDS = 100; > Sleep(DELAY_IN_MICROSECONDS); Sleep() takes a parameter that represents *milliseconds*, not microseconds. I just wanted to point that out in case readers don't study the documentation you linked to closely enough, and then find Sleep() doesn't have the granularity they want. | |
Re: > Because when you rename the structure list to list_t but nowhere was struct list defined before that line. That's not a problem. You can use an incomplete type as the alias in a typedef, provided there's no instantiation of the typedef that would require the alias to be complete … | |
Re: > But I don't know how to implement the necessary code to print the number pyramid. It's a little more complex than what you've done. I'd suggest breaking each line down into four parts: 1. Leading whitespace. 2. The leading half of the row. 3. The midline of the row. … | |
Re: > i dont understand why i get output for cases (step number: 3,4,5 and 8,9,10) when "low" and "high" are equal, where as the if() condition in the partition() block states recursion only when low<high... That might be confusing if your output were performed *inside* the `if` statement's body, but … |
The End.