Tellalca 19 Posting Whiz in Training

Command line arguments are passed to programs automatically when you use them. You just define and use them if you need them, which is almost never done if you are not using a command line based Linux OS.

What you do to run a program on command line, you call it like "myprogram.exe". If you want to run it with arguments like -debugmode, you can add the parameter "myprogram.exe -debugmode".

Then this first argument is assigned to your char** string array.

Tellalca 19 Posting Whiz in Training

I think you can't do that with the current C#. Maybe if you can edit the CLR and modify the compiler to create appropriate IL when you use your "own" type then you can manage it, which is almost impossible :D

You can try C++ though!

Tellalca 19 Posting Whiz in Training

Why not use placeholders?

Tellalca 19 Posting Whiz in Training

Why not use Print button on the browser or keyboard?

Tellalca 19 Posting Whiz in Training

You need to send the whole code.

Tellalca 19 Posting Whiz in Training

is your web server running?

Tellalca 19 Posting Whiz in Training

Yeah maybe %99 terrorists are Muslim but %100 despot occupiers are Christian. So blaming religions is not a way to describe that.

Tellalca 19 Posting Whiz in Training

First versions of Linux kernel was developed by a lone man called Linus.

almostbob commented: ** AWESOME ** +0
Tellalca 19 Posting Whiz in Training

Yes it is possible. You have to work with your OS api.

And it is easy, in Linux just observe running processes and conditionally create a new thread and use execv() to run a specific program.

Tellalca 19 Posting Whiz in Training
#include <iostream>
#include <string>
#include <time.h>

#define private public

using namespace std;

void sleep(clock_t wait)
{
clock_t goal;
goal = wait + clock();
while(goal > clock())
;
}

void memoryleak() {
    sleep(2000);
    long long  int i = 0;

    while(i < 999) {
        i++;
        cout << "HAHAHA\n\n\n";
    }
    long long int g = 0;
    while(g < 9) {
        g++;
    }

    int* d = new int;
    *d = 0;
    delete d;
    *d = 0;
    cout << *d << "\n";
    d = new int;
    while(true) {
        cout << "HAHAHA\n\n\n";
    }
}


class someclass {
private:
string variable;
};


int main()
{
    someclass a;
    a.variable = "I hacked your string!";
    cout << "HACKED!!   " << "Your changed your variable value to " << a.variable;
    cout << "\n\n And now random memory leak!!!!";
    sleep(2000);
    memoryleak();
    return 0;
}

I know, I am evil :p

Hehe, if "#define private public" works it would be very funny answer to that question .)

Tellalca 19 Posting Whiz in Training

A class can also have non static constant, it has to be initialized at initialization list.

class A{
   const int a;
   public:
   A(int a) : a(a){
   }
};

You can not do

int &var=NULL;

and there is a reason behind it.
any & is reference and once it is initialized, it can not be initialized again, so NULL is not a varaible/memory which & refer to.
You can not even do this:

int &var=2;

but you can do

int *p = NULL;

, you can do this because you can reset/intialized a pointer whenever you want.

What is the point of having a non static const in your class, just asking to learn, no offense.

Tellalca 19 Posting Whiz in Training

If we could tell you how to create such websites in a few sentences, everyone would be a web developer, right?

Tellalca 19 Posting Whiz in Training

There is no loop. So you randomize the color only once, that is why you see only one color.

Tellalca 19 Posting Whiz in Training

It's worse to use "int main(int argv, char** args)" because you loose two variable names if you won't use command line arguements or if the system does not support it .)

Tellalca 19 Posting Whiz in Training

I don't know Phyton but here is the algorithm

counter = 0

while : number >= 1
number = number / 10
counter = counter + 1

print counter

Tellalca 19 Posting Whiz in Training

Pointers are not rocket science. It is actually an a variable storing the adress of the variable you are pointing.

int n = 10; // this is an ordinary variable
int *a = &n; // this sentence means a is a pointer to an integer and evaluated to the address of n

It is as simple as that. What you must really understand is why we need to use pointers.

Do a search about it. And do lot of practices like sorting, printing, editing array like data by using pointers. Passing data back and forth between functions.

Tellalca 19 Posting Whiz in Training

maybe the problem was with your router.internet does not effect your LAN i think.

Tellalca 19 Posting Whiz in Training

Google may not be so random, try facebook :) Yes the HTTP protocol uses port 80.

Tellalca 19 Posting Whiz in Training

Use the CODE-tags

Tellalca 19 Posting Whiz in Training

Use some structs, classes, functions and loops in your game. You cant write a game like writing a story. You have to reuse the code you have already written like,

printMenu() // function that prints menu 
struct player
{
  int hp;
  int damage;
  int magic;

}// carries information about your character
Tellalca 19 Posting Whiz in Training

You may want to define a constructor and a copy constructor.

Tellalca 19 Posting Whiz in Training

Maybe because of the limits of the integer type. Integers can hold numbers up to 32768 ( as i remember ). So any value greater than 2^16 will overflow and give you uncorrect results. You may try using double or a user created type to hold values for factorials as factorials can overgrow quickly.

Tellalca 19 Posting Whiz in Training

You are very welcome :)

Tellalca 19 Posting Whiz in Training

You can assign the value returned by the function "strlen(textStr)" so you avoid calling this function strlen*26 times :)

int a = strlen(textStr);
 for(j = 0; j < a; j++) {
...
}

Maybe you should use binary files instead. This will decrease the encoding and decoding of the string that will be placed into the buffer, reducing the time your program consume dramatically.

Tellalca 19 Posting Whiz in Training

Ofcourse it is possible, but if you want us to implement and send you the code that's not gonna happen.

Maybe you should send what you've got, then we may give you some ideas.

Tellalca 19 Posting Whiz in Training

Does the function ( read/write ) you first call in the program works and the following does not?

If so maybe you should do some procedure before attempting to do another work. I never programmed serial port before , it is just an idea :)

Tellalca 19 Posting Whiz in Training

First if you want to dynamically enlarge the array you should use malloc and calloc, which dynamically reserves memory while the program is running.

If you want to insert values to an array, you should have the array element at the right side of the expression like "arr = something;".

You should reserve some space in the memory when you declare an array like "char arr[arraySize]" if you want to insert ( actually assign values to existing array elements ) values to the array.


main()
{
int i;
int arraySize = 10;
char myArray[ arraySize ] = {'a'};
for( i=1; i < arraySize; i++)
myArray[i] = ( char )i;

return;
}
Tellalca 19 Posting Whiz in Training

With inserting you mean manipulating a picture with C?

Actually with using C you can almost do anything. There are some tools to use for editing pictures using C.

BMP (bitmap) files can be edited bit by bit. You should check the following links:
http://en.wikipedia.org/wiki/BMP_file_format
http://www.vbforums.com/showthread.php?t=261522

Tellalca 19 Posting Whiz in Training

If you can send the reorganized .cpp and .h files maybe we can help easier.