type 2 is actually better.. Type 1 holds all that memory until the end of the program...type 2 can actually free up that memory on that spot.
Type: Posts; User: prophet
type 2 is actually better.. Type 1 holds all that memory until the end of the program...type 2 can actually free up that memory on that spot.
That is the most basic way of sorting but your idea is correct now. Glad I could help =)
use indentations to spot errors easier. Your code seems fine...its your cout statement that is wrong. Basically when you cout like that your printing out the 4th element in the 2nd array. So in...
.swf files(flash code) can be decompiled...
You just did the program for him. The point is that you're supposed to help him understand the concepts...not GIVE him the program =P
you have two problems in your code. First off you only sort only between two elements that are NEXT to each other...what about the stuff before them? For example:
21 20 18 2 //pretend thats...
C++ is slower than C in only some ways. OOP will no doubt be slower than regular procedural/functional calls just because it causes a bit more of an overhead. If you code in C++ using C syntax(such...
you can get visual.net academic for free if you goto one of microsoft's seminars. They throw them at various schools throughout the region. I went to one in philadelphia(temple) and I got...
disabling right clicking is not even worth it. You can still click on view->source if your in IE or whatever. You can TRY to block people with frames but again its easy to get around by just...
Your describing a vector...in that case there is a standard template library for it. It is also more efficent to DOUBLE the size of the new array instead of increasing it by one. Just think of how...
In programming often times you will have to do something on every OTHER increment. A nifty trick I picked up that makes that idea very easy.
for(int i=0;i<10;i++)
if (i%2 == 0)
//do...
wanna see something messed up that me and a friend discovered? In g++ and bcc i know this error occurs...but in VC++ it does not.
void main()
{
int *arr = new int[10];
arr[5] = 4;
...
are you trying to flip the console? Basically IF you had everything stored in a 2D array you just do what everyone said. Just think of your screen as a 10x10 matrix (or whatever size you want) and...
like the post below said it will take up 100bytes of memory. This is why variable reuse is a good idea especially for temporary variables such as incremental counters ("i" is often used for that)...
i'm sure there are programs written for this already. The point being is that this isn't a request for program board...if you want a custom program I would suggest you pay a custom program price.
I think he means something like this:
struct blah {
int number;
string stuff;
}
sorting algorithm(blah a[])
I'm assuming that you would need to do some sort of threading if you want real time stopping (stopping the watch at exactly the time you hit the key). Unfortunately I have never messed with...
classes in any compiler is the same. What exactly do you not understand...
Recursion is a way to simplify code. There is ALWAYS a base case (if you forget this step you will get an infinite loop) which will exit the function. Recursion will not work for everything.. a...
Well its almost the same as the constructor for example:
class controlbox{
private:
phone system[10];
int CM; // checking messages
int HU; // hang up
int busy; // line busy
Yah its correct but, your coding style is pretty bad. Why do you have so many if statements for the SAME condition?
Try looking up switch/case statements since it will help simplify your code. ...
I would use a case statement since it'll be easier to add in extra features later on and plus its easier to read than 3 if statements.
#include <iostream>
int main()
{
int x;
cin...
um why not store the returned answer from calctotime into a variable and reuse it?
such as:
int foo = calctottime( t1,t2,t3);
then calling the function with the variable:
calcmins(foo);...