- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 9
- Posts with Upvotes
- 8
- Upvoting Members
- 9
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: I've often used C/C++ to do just simple trivial tasks like trying out an algorithm or doing exercises so usually creating projects is such a pain in the ass. In this regard, I've preferred something like Code::Blocks because you can compile a single source file without the need of a … | |
Re: > HTML, XML, CSS, etc. are not programming languages, they are markup languages, so people who use them are not programming. Instead they are writing scripts for a browser to interpret. Then again, when you are programming in Java, you are technically writing 'something' that the JVM would interpret. I … | |
Re: IE is using the 'old' or 'Quirky Mode' renderer by default to accomodate for things written back when 'standards' weren't a thing. You can override that. ;) Backwards compatibility is so NOT cool from a developer point of view. | |
Re: Would you maybe post the full code, if it's not too long? Also, when you use 2 dereferencing operators, you are accessing each individual sub-array index so doing `sizeof(STUDENT*)*first` would be a logic error. I find the error new to me. Are you perhaps using a C++ compiler/IDE? | |
Re: I've been taught in my freshman class that `sizeof` was a function, or at least it was persistently addressed as such, and I didn't really know any better at the time. I think he is under the same boat. `sizeof` is not a function, but is more of an operator. … | |
With code like so: [BITS 16] ; 16 bit code generation [ORG 0x7C00] ; Origin of the program. (Start position) ; Main program main: ; Put a label defining the start of the main program call PutChar ; Run the procedure jmp $ ; Put the program into a never … | |
Re: Start small and demonstrate to yourself how each programming constructs work (e.i. conditions, loops, functions). Try to make compute-the-sum programs and then integrate each feature you don't know how to use. There needs to be an initiative from yourself to break through that initial learning curve. | |
Re: Alternatively, > L = 30 + { [ M + floor(M/8) ] MOD 2 }, where L is the month length in days and M is the month number 1 to 12. The expression is valid for all 12 months, but for M = 2 (February) adjust by subtracting 2 … | |
Re: An array, as in an automatic/global variable like `char ray[2];`, cannot be used with `++` or any other trick that will change its value because it is an object-like context -- it doesn't hold a value per se but rather itself is that value, if that makes sense. This is, … | |
Re: `?:` is an operator that works similar to an `if` construct except it can return a value when used on an expression. The syntax is `[condition] ? [statement1] : [statement2];` where statement1 is executed if condition evaluates to true, statement2 otherwise. Literally, that should evaluate to returning `'O'` like `char … | |
Re: Learning to use a graphics/drawing API would be a start. SDL would do fine. | |
Re: One would be to simply call some OS functions. Not exactly as on-the-go as a batch file because of compilation, but I would consider it more powerful... I reckon something like ruining all the file names on a directory, or even wiping out a hard disk would be perfectly doable. … | |
Re: It would help to read the error message, which mine read somewhere along the lines of `empty character constant`. Unlike strings(double quotes), there is no implied value(nul value, '\0') in a character literal(single quote) so it would produce an error. Fill the single quote with a space since that's what … | |
Re: I think it's called a shortcut. You can create it yourself on Windows and then maybe include it in your distribution. Right click on your executable and you can create the shortcut. | |
Re: I think OP isn't in need of tutorials, but exercises. I like Project Euler. There's also Code Kata. | |
Re: OSDev is a great resource. Warning: Only for real warriors and not the faint-hearted; not a step-by-step manual but rather a general repository for OS development. I don't think a 'how-to' exists for OS development. When all else fails, you can browse through stuff like `Minix`. | |
Re: Maybe because your pointer-to-pointer `arr` doesn't really have the memory to store the tokens; it's just an array of pointers. What you could do is after creating the array of pointers, allocate memory for strings to every single pointer in the array. Also, personally, I find that `calloc()` is easier … | |
Re: The outer `for` loop in line 3 can be thought of as the counter for the progress of the sorted part of your list/array. The inner `for` loop in line 4 is a loop that traverses the unsorted part of the list. Remember that the outer `for` loop at line … | |
Re: A 'corrupted pointer' could be a pointer that points to already free'd data (when using dynamic allocation via malloc/calloc), or maybe just something that contains an address that you don't intend for it to contain. That being said, you don't just 'find out' whether or not a pointer is a … | |
Re: So the `start` denotes that the particular process should be executed after `[param] ms` has passed, correct? So as the 1st process executes, after 5 ms of its execution(in the middle of `run 10`), it will run 'along side with' the second process which was due to run after 5 … | |
Re: printf("%d", x); "%d" is a placeholder telling printf() of the type of the variable and whatever type this variable is it will be treated as what the placeholder describes it to be. Giving a value of type pointer while specifying the value as type integer would still make printf() behave … | |
Re: > if user guesses the number right it only displays the guesses up to that number, and i would like to display all guesses including the correct one. Because you are passing variable n to the DisplayGuesses() function which acts as an index in your loop while inside your DisplayGuesses() … | |
Re: You could learn GBA programming, which is pretty low level C. http://www.coranac.com/tonc/text/ You can settle for less and simply do console-based games. If you find something like DirectX and other equivalent libraries too overwhelming, you could try out drawing libraries like GDK or Qt(which is C++) which isn't quite the … | |
| Re: For starters, you can simply index the vector like you would to an ordinary integer array. cout << nVector[0]; Would refer to the first string object in the vector. If you feel overwhelmed by the homework, go spend a whole weekend reading turorials and implementing simple pieces of code to … |
Re: You could try a sort of divide-and-conquer approach and exploit the properties of multiplication. Think about this: [CODE] 2^16 2^8 * 2^8 2^4 * 2^4 2^2 * 2^2 [/CODE] Where you divide the problem into something that is more manageable. Due to the symmetry of the products, solving 2^2, for … | |
Re: You can just always parse the input yourself by getting input as string then converting it to integer via atoi(). Perhaps its one of the quirks of scanf(). scanf() continuously scans the input buffer until it finds a space or nextline. From my testing, it also completely stops reading when … | |
Re: Since the input is sure to be divided only between string and value, and that there won't be any input like stri3.1415ng, keep on looking at the input until you find an integer. At which point, what you have read so far can be put into the structure's array component. … | |
Re: That depends on how you defined/allocated your array. Most likely you defined it as an automatic variable in main(or any other function), which gets allocated in the stack, which is a limited resource. It's called a stack overflow. [code] int main(){ int thearray[SIZE]; sort(thearray); return 0; } [/code] What you … | |
Re: How about have an array which index corresponds to a particular user, say an element will contain a user_id. Resize array when you want a user to gain more probability and give that resized space another user_id. rng the given index range. You can either log the indexes that correspond … |