Narue 5,707 Bad Cop Team Colleague

The best is the one that works best for your needs. Try out several, there are quite a few free ones you can use to get a feel for what features you want.

Narue 5,707 Bad Cop Team Colleague

What line does the error refer to, and how are you compiling your program?

Narue 5,707 Bad Cop Team Colleague

Post your tips for making life easier in C and C++. I'll start:


Standard vector object initialization

The biggest problem with the standard vector class is that one can't use an array initializer. This forces us to do something like this:

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  vector<int> v;

  v.push_back(1);
  v.push_back(2);
  v.push_back(3);
  v.push_back(4);
  v.push_back(5);

  // Use the vector
}

Anyone who's had the rule of redundancy pounded into their head knows that the previous code could be wrapped in a loop:

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  vector<int> v;

  for (int i = 1; i < 6; i++)
    v.push_back(i);

  // Use the vector
}

However, it's not terribly elegant, especially for a vector of complex types. So, Narue's first timesaving tip for C++ is to use a temporary array so that you can make use of an initializer. Because the vector class defines a constructor that takes a range of iterators, you can use the array to initialize your vector:

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int a[] = {1,2,3,4,5};
  vector<int> v(a, a + 5);

  // Use the vector
}
Duki commented: goodpost. my prof used it in class +4
Sturm commented: Pretty cool, never knew that. +2
Narue 5,707 Bad Cop Team Colleague

>Though you may be able to compile C code in Dev-C++.
You can. You just need to be sure that the source file extension is .c instead of .cpp.

Stack Overflow commented: Thanks for the info. -Stack Overflow +1
Narue 5,707 Bad Cop Team Colleague

Each of these are rather broad topics. Can you cut it down to specific questions so we don't have to write page after page of tutorials?

Narue 5,707 Bad Cop Team Colleague

Member functions can be simply called in one of two ways. If the function is declared as static then you call it using the scope resolution operator and the name of the class:

class C {
public:
  static void foo();
};

// ...
C::foo();

If the member function is not declared as static then you must call it using the member access operator and an object of the class:

class C {
public:
  void foo();
};

// ...
C obj;
obj.foo();

In your case, the line in question should be changed to:

cout << "the distance is" << pt1.getDistance(pt2);

Alternatively you could say:

cout << "the distance is" << pt2.getDistance(pt1);

Because this shouldn't effect the distance between the two points. The key is understanding that at least one of the objects passed to perimeter should be used as the base object that you call getDistance on and the other object should be passed as the argument to getDistance.

Narue 5,707 Bad Cop Team Colleague

>I don't know what language your are using so I'm being vague.
You could assume either C or C++ and probably hit the mark. :rolleyes:

>is there any function available to enable it??
Poor man's profiler:

#include <stdio.h>
#include <time.h>

clock_t start = clock();
/* Code you want timed here */
printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
ProShashank commented: how to get CLOCKS_PER_SEC??? +0
Narue 5,707 Bad Cop Team Colleague

>void main()
This is not, and never has been, correct C++. The C++ specification requires main to return an int.

>Never ever ever use goto stmts.
Normally I'd call you a moronic conformist, but you've shown yourself to be fairly knowledgeable. So I'll give you a chance to argue your case and then consider taking back the "never ever ever" part before I become the evil voice of reason.

Narue 5,707 Bad Cop Team Colleague

Using global variables makes your code harder to follow. But I immediately found this error:

for (int x = 1 ; x <= number_students; x++)

Why are you starting with 1 and ending at number_students when the array only goes from 0 to number_students - 1?

This is suspicious as well:

for (int x = 10 ; x < number_students; x++)

Why are you starting with 10?

Narue 5,707 Bad Cop Team Colleague

>I am eagerly waiting for Narue's and Christian's solution of Alfarata's problem!
The design is flawed to begin with. There's no good solution. If you ask the user for a filename, it's only reasonable to require the full path. If you require the full path then what possible use could you have for discarding the extension and tacking on .csv? What if it's not a CSV formatted file?

Narue 5,707 Bad Cop Team Colleague

>This assumes that the user has some kind of brain.
You mean the hypothetical imaginary user that university professors use to avoid teaching students the reality of error checking? I've never met such a user in real life.

>you have to detect the period character in the entry string with strchr()
Filenames with multiple periods are common. A perfectly valid filename would be destroyed by this method, resulting in an obscure error.

Narue 5,707 Bad Cop Team Colleague

>Be nice to people, either answer their Q's or simply dont make fun of them, please.
<NOPOST>
Analyzing...

Dave Sinkula:
583 posts
Known guru
Nice and helpful

Intel:
11 posts
Does not seem very bright
Nice and gullible

Conclusion:
User "Intel" tries to act smart and pretend he knows what he is doing
User "Dave Sinkula" actually helps people

Searching database for appropriate response to user "Intel"...
</NOPOST>
Dave did answer the question. You're just not smart enough to look beyond your own ego and see it. Get over yourself, read the rules, and shut the hell up until you can post a quality response.

frrossk commented: for your whole activity +1
Narue 5,707 Bad Cop Team Colleague

>temp->ptr=start1;
temp->ptr is a pointer to a link structure, start1 is a pointer to a link1 structure. They are not interchangeable.

Narue 5,707 Bad Cop Team Colleague

It's been at least three months since I last looked at one of your posts, and you've learned nothing. Maybe if you actually tried to write good code, it would be easier to find your many mistakes.

>plz make necesaary changes in my code to make it properly run
This is incredibly rude. You're assuming that we care about you and your program and that you're entitled to a complete rewrite by us. This sentence alone is why I refuse to help you.

Narue 5,707 Bad Cop Team Colleague

>I'm here to query you on a doubt I have in dynamic initialization.
You sound like less of an idiot when you speak clearly. "I'm here to ask you a question I have about dynamic memory" is much better than trying to sound smart by using uncommon and inappropriate words.

>dynamic memory is allocated from a heap or a free memory.
Heap, pool, free store, it's all just a big block of memory that you can grab chunks from.

>I require to determine how much free space I already have
Require is an awkward choice of words, what's wrong with "need" or "want"? Though "want" would be better because I very much doubt that you "need" to know. If you do "need" to know then your design is probably flawed.

>How do I determine how much free space the heap has remaining?
When new throws a bad_alloc exception, you can assume that you're out of dynamic memory. However, virtual memory goes a long way toward making such exceptions nearly impossible. For that reason, it's safe to assume that the amount of available dynamic memory is limited only by storage space and your tolerance for thrashing.

>mismatch, yes, I know
If you know, why do you continue to use a relic compiler on a modern operating system? Are you just a masochist?

>Would it help if I paste all 1100 lines of code here?
Sure, why not? Everyone will ignore …

Narue 5,707 Bad Cop Team Colleague

>Can't seem to figure this out.
You're not the only one. There isn't a portable way to get the size of a dynamically allocated array. You need to pass the size to your function:

void addNodes(string names[], size_t size)
SpS commented: Right ~~SpS +3
Narue 5,707 Bad Cop Team Colleague

>This coming from a card carrying java hater is a real surprise.
What? It's a surprise that I hate a language yet still use it and recommend it? I'm not so foolish as to be unable to look past my own opinions, unlike some people I won't name.

>You guys should really read Narue's blog on java.
You should stop ignoring things that don't fit into your own conclusions. If you read all of my blogs, you'll see that I don't have as much of a problem with the latest version of Java. A lot of the non-fundamental issues were addressed, and that pleases me. But you wouldn't understand because you've already tagged me as a person like yourself that doesn't have an open mind and never changes their opinion in light of new information.

>Narue you also said "I'm sorry, I handn't realized that was a requirement" referring to forth
I wasn't referring to Forth. Try reading for comprehension sometime.

>As for Forth it is also known as the hacker's language. <snip silly comments>
Odd, I've been in the Forth community for some time now and I have yet to hear that. Maybe you're just trying to fake your way out of not knowing something.

>let me let me advice you guys not to be jack of all trades and master of none
Yet another wonderful suggestion from the woefully misinformed. There's no point in arguing why this recommendation is …

Narue 5,707 Bad Cop Team Colleague

>study java or continue my MFC????????????????????
Both. The more, the merrier.

>I was told to learn VB first, and then C++.
Learn whatever looks most interesting to you. If somebody tells you to learn a language and you hate it then you've just sold yourself short. VB is recommended because it's easy and powerful at the same time. C++ is recommended because it's incredibly flexible. Java is recommended because it's not as intense as C++. Here are a few of the languages that I've found interesting, at the very least:

C, C++, Java, C#, VB, Perl, Python, Forth

This might give you a start for research before you pick a language to focus on. Each of these is useful, popular, and different enough from any of the others to give you a new flavor of programming.

I never recommend C, C++, Java, or C# as a first language. They're meant to be used by real programmers solving real problems. As such, they're awful as a learning language, though Java and C# are better than C and C++. Python is easy to follow, and Forth is about as simple as programming gets, but Forth is harder to find good information on than Python. Perl is fun. Very fun. But unless you learn it the right way, you'll be confused (as you will with any language that can look like line noise without any effort).

My best suggestion is to get a list of programming …

Narue 5,707 Bad Cop Team Colleague

>You're asking for help in a criminal activity.
Technically, writing a virus isn't a criminal activity. Deploying a virus is because it violates the privacy of the target systems. It's irrelevant whether the virus is benign or harmful at that point, but the more damage it does, the worse the crime is.

There are perfectly legitimate (scientific) reasons for writing and studying a virus, but only if it's contained in a clean system owned by the party doing the tests. Unfortunately, that's almost never the intention. :(

>but virii No.
The correct plural of virus is viruses, not virii.

jack1505 commented: can u give me some coding for create virus.... +0
Narue 5,707 Bad Cop Team Colleague

Your inconclusive links that completely miss the point have changed my mind! I'm now a devout Java user who will never turn to other languages even if they appear better at first glance or are in a different problem domain than Java! All bow before Richard West for he is a genius!

Yours Sincerely

Someone with an open mind.


Asnwer me this. Java may be everyone's choice for writing new code. But what are we going to do with the hundreds of millions of lines of code that aren't Java? Are we going to convert it to Java just because it may be a better language? Because it may be simpler? Because it has an overwhelming set of "standard" libraries?

What about systems programming? Do you have a link that shows Java to be superior to C for writing an operating system efficiently? I don't see Sun writing Solaris in Java, do you?

Tell me, do you have a toolbox with nothing but a hammer because a hammer can "fix" any problem? I have nothing against Java, but I believe strongly that no language will solve all of your problems, simple things usually aren't, OOP is totally overrated and abused, and people who advocate any one language or methodology are closed minded fools.

Now, tell me where I'm wrong. Of course, I don't expect you to see the light simply because you're too entrenched in your own petty likes and dislikes to …

Narue 5,707 Bad Cop Team Colleague

Either you're a troll, or you're a braindead Java advocate. Either way, I'm not going to waste my time with you. So, you believe what you want to, and I'll continue to use whatever tool is best for the job.

Narue 5,707 Bad Cop Team Colleague

>Seriously C++ days are numbered.
You're an idiot. There were people like you who ignorantly thought that COBOL's days were numbered in 1974. Lo and behold, COBOL is still used quite a bit 30 years later. So, you're an idiot, and I won't waste my time explaining why since you're clearly not intelligent enough to understand.

Narue 5,707 Bad Cop Team Colleague

>Narue, ever tought of becoming a teacher
Yes, but if it's anything like the "tutoring" I do with the programmers working under me, I would be fired in an instant for verbal abuse. ;) It's not that I'm really that bad, it's just that people are too touchy these days.

Narue 5,707 Bad Cop Team Colleague

>1. design support for 'programming in the large'
We let you write big programs.

>2. a modern object model that supports concurrency: activities in objects replacing passive method calls
We let you do more than one thing at a time.

>3. formalised interaction between activities (dialogs)
We force you to put things together our way.

>4. good for both structured and OO programming styles for a wide range of applications ... OS to business
We're slaves to the latest trends and buzzwords.

>5. support multi-processor and distributed systems
We don't restrict you to MS-DOS.

>6. support inter-operation with other languages and their libraries
You can use stuff from other languages that we think are important.

kc0arf commented: Refreshing, and nicely anti-Microsoft +3
Narue 5,707 Bad Cop Team Colleague

>How do i deal with a colour image (probably in .tiff format)?
The code for processing an image depends heavily on the image format. Go here and read up on the .tiff format to see what's involved.

Narue 5,707 Bad Cop Team Colleague

Something along these lines:

import java.util.*;

class Main {
  public void display_menu() {
    System.out.println ( "1) Option 1\n2) Option 2\n3) Option 3" );
    System.out.print ( "Selection: " );
  }
  
  public Main() {
    Scanner in = new Scanner ( System.in );
    
    display_menu();
    switch ( in.nextInt() ) {
      case 1:
        System.out.println ( "You picked option 1" );
        break;
      case 2:
        System.out.println ( "You picked option 2" );
        break;
      case 3:
        System.out.println ( "You picked option 3" );
        break;
      default:
        System.err.println ( "Unrecognized option" );
        break;
    }
  }
  
  public static void main ( String[] args ) {
    new Main();
  }
}
Narue 5,707 Bad Cop Team Colleague

>am i on the right track at all?
Does it work? If so then you're on the right track, otherwise you're doing something wrong.

Dave Sinkula commented: :p +1
Narue 5,707 Bad Cop Team Colleague

>How to calculate time complexity of any algorithm or program ....
The most common metric for calculating time complexity is Big O notation. This removes all constant factors so that the running time can be estimated in relation to N as N approaches infinity. In general you can think of it like this:

statement;

Is constant. The running time of the statement will not change in relation to N.

for ( i = 0; i < N; i++ )
  statement;

Is linear. The running time of the loop is directly proportional to N. When N doubles, so does the running time.

for ( i = 0; i < N; i++ ) {
  for ( j = 0; j < N; j++ )
    statement;
}

Is quadratic. The running time of the two loops is proportional to the square of N. When N doubles, the running time increases by N * N.

while ( low <= high ) {
  mid = ( low + high ) / 2;

  if ( target < list[mid] )
    high = mid - 1;
  else if ( target > list[mid] )
    low = mid + 1;
  else break;
}

Is logarithmic. The running time of the algorithm is proportional to the number of times N can be divided by 2. This is because the algorithm divides the working area in half with each iteration.

void quicksort ( int list[], int left, int right )
{
  int pivot = partition ( …
Killer_Typo commented: WOW incredible post, most of it over my head but all the same, incredible! +4
hamidvosugh commented: Excelent brief +3
Narue 5,707 Bad Cop Team Colleague

How do you define the measure of complexity? If the measure is number of features the Ada, PL/I, or C++ would be near the top of the list. What about the ability to describe the same solution in a huge number of ways? Well, at that point my vote might be for Perl. Lack of clarity? Assemby language takes the crown, but Perl would have a special mention because at times it can resemble line noise. Then there are the huge number of languages that I either have no experience with or didn't bother to mention because they aren't very popular in the mainstream. Comparing languages is an exercise in futility unless you have a specific use in mind.

>So what language you recommend?
PHP is an Algol decendent, just like C, C++, C#, and Java. You would find the syntax of any one of those to be comfortable. However, there is much to be said about Lisp or one of its variants. While you may not use it--ever--you will learn a great deal about programming by learning a language that is so different. If you want to ease into the pool a little bit more slowly, go to C, C++, C#, and Java by way of Python and Perl.

In the end, the choice is yours and you should learn whatever language looks most interesting to you.

Narue 5,707 Bad Cop Team Colleague

>I'm trying to compare a string to an ArrayList Object.
This is your problem. Unless you can figure out a way to convert the ArrayList to a String so that they are comparable, you'll need to manually compare each item individually in a loop.

Narue 5,707 Bad Cop Team Colleague

Welcome aboard! I hope your experience is a good one. :)

Narue 5,707 Bad Cop Team Colleague

>warning: no newline at end of file
Go to the end of the file and hit enter. Save and recompile.

>undefined reference to `sin'
Did you link to the math library?

gcc src.c -lm
Narue 5,707 Bad Cop Team Colleague

>what else do i nned to change
It depends. Does it work when you paste it into your HTML file? I don't see anything wrong, so the only issue would be whether the link is valid or not.

dlh6213 commented: Thanks for helping my son with this; he's surpassing me in some areas! -- dlh +1
Narue 5,707 Bad Cop Team Colleague

You can find code for this all over the place. Here is how I did it a while back in response to a similar question:

#include <stdio.h>
#include <string.h>

char *wordbuild ( char *n, int ncomm )
{
  int i, nleft, len;
  char *p = NULL;
  static char ret[1024];
  
  /* Word lists */
  static char *ones[] = {"one ","two ","three ","four ",
    "five ","six ","seven ","eight ","nine "};
  static char *tens[] = {"ten ","eleven ","twelve ","thirteen ",
    "fourteen ","fifteen ","sixteen ","seventeen ","eighteen ","nineteen "};
  static char *twenties[] = {"","twenty ","thirty ","forty ",
    "fifty ","sixty ","seventy ","eighty ","ninety "};
  static char *hundreds[] = {
    "hundred ","thousand ","million "};
  
  memset ( ret, '\0', 1024 );
  len = strlen ( n );
  
  for ( i = 0; i < len; i++ ) {
    if ( ( p = strchr ( ( n[i] == ',' ) ? &n[++i] : &n[i], ',' ) ) == NULL )
      p = &n[strlen ( n )];

    if ( n[i] == '0' )
      continue;
    
    if ( ( nleft = ( p - &n[i] ) ) != 0 ) {
      if ( nleft == 3 ) {
        strcat ( ret, ones[n[i] - '0' - 1] );
        strcat ( ret, hundreds[0] );
      }
      else if ( nleft == 2 ) {
        if ( n[i] == '1' ) {
          strcat ( ret, tens[n[++i] - '0'] );
          nleft--;
        }
        else
          strcat ( ret, twenties[n[i] - '0' - 1] );
      }
      else
        strcat ( ret, ones[n[i] - '0' - 1] );
    }
    
    if …
Narue 5,707 Bad Cop Team Colleague

>I know what you are saying, but would you mind listing examples.
The simplest example is an array of pointers. Do you want to compare the value of the pointers or the value of the addresses pointed to:

#include <stdio.h>
#include <string.h>

int main ( void )
{
  static int a = 10;
  static int b = 20;
  static int c = 10;
  static int d = 20;
  int *aa[2] = { &a, &b };
  int *ab[2] = { &c, &d };

  if ( memcmp ( aa, ab, 2 * sizeof ( int ) ) == 0 )
    puts ( "Equal" );
  else
    puts ( "Not equal" );

  return 0;
}

Most likely it's the former, so memcmp would give the wrong answer unless by some coincidence both arrays all have pointers that reference the same addresses.

>It'll be something like this
No it wouldn't, that code is awful. The concept is sound, but the implementation sucks. Here are a few reasons why:

>#include <iostream.h>
Not C++.

>#include <conio.h>
No portable.

>void main()
Undefined.

>clrscr();
VERY nonportable.

>cin>>n;
Not robust.

>for(i=1;i<=n;i++)
Poor style, not idiomatic.

>cin>>a;
Not robust, difficult to recover from on error.

>g=1;
>while(g==1)
>{ g=0;
Confused and awkward.

>getch();
Not portable and stupid because there's a standard alternative that works just as well.

And on top of that, you didn't use code …

Asif_NSU commented: It's good to know there's an uncompromising critic out there-- Asif_NSU +1
Narue 5,707 Bad Cop Team Colleague

>but when i run it it does not do the conversion
You don't print the value of ch after the conversion.

>#include<iostream.h>
This is an old header that is no longer a part of the C++ language. Use <iostream> instead. You also need to consider namespaces, but for now simply adding using namespace std; will suffice.

>#include<conio.h>
This is a nonstandard header that is not supported by all compilers. Even those compilers that do support it offer different contents. That's definitely not conducive to robust and portable programs. Remove this and replace getch with cin.get.

>void main()
main does not, and never has, had a return type of void. The return type of main is int, and anything else is wrong.

>clrscr();
This is one of the functions that is pretty much only supported by Borland. Clearing the screeen when running a console program is almost always antisocial and it serves no useful purpose, so you shouldn't do it.

>{
There's no need to introduce a block before your first if statement. You can safely remove it because it's just clutter.

>if((ch>=65)&&(ch<=122))
Don't use the ASCII values for a test like this, they're not portable at all. A slightly better way would be:

if ( ch >= 'A' && ch <= 'z' )

But there are two distinct issues with this. The first is that between the upper case letters and the lower case letters in …

Killer_Typo commented: damn! a great reply i must say +6
Narue 5,707 Bad Cop Team Colleague

>It would just be cool if there was some super compiler.
Yes, it would. But the lexical analyzer would be a bitch to write.

Narue 5,707 Bad Cop Team Colleague

>what is the best compiler
What's the best pizza topping? Try again.

>what is the best compiler out there that you can use for a variety of languages. Like is their a compiler that can compile c++, the basics, java, etc.
Better. No such compiler exists. The closest you will get is a C++ compiler that can also handle C. Try again.

>I am just looking for a good compiler that is free and if possible can compile more than one prog. lang.
Now I know what you're looking for. Here is your best bet.

Narue 5,707 Bad Cop Team Colleague

Ah, yet another mindless Microsoft hater who clearly isn't aware of the issues and thinks that calling Bill Gates evil will say everything that needs to be said. Blanket statements like that just serve to indicate your idiocy and lack of awareness. But to answer the request, I have nothing against Bill Gates. He's an intelligent man and has done very well for himself. I even met him once, he's also very friendly and certainly not what I would call evil after a few minutes of chatting.

Narue 5,707 Bad Cop Team Colleague

AMD used to be inferior to Intel, but not so anymore. I would say that they're evenly matched these days. Of course, I don't overclock, so I can't help you there.

Narue 5,707 Bad Cop Team Colleague

>It looks as if you are automatically assuming that Z is an integer
That's a reasonable assumption seeing as how Z was declared as int.

>When it's not an integer, but it's treated as one, you could end up in some sorta loop further down in your program.
The problem is with cin. The >> operator of cin will figure out what type the object is and convert the data from the standard input stream to that type. If there's no conversion then cin will leave the unconverted data in the stream and enter a failure state. This is a common problem with loops like this:

int number;

while ( cin>> number )
  cout<< number <<endl;

If a letter is entered, this will be an infinite loop because cin will continue to fail on the invalid data in the stream. The solution is to remove the offending input and clear the stream or read all data as a string and parse it for error handling. The latter is easy and the former can be done (rather naively) like this:

#include <iostream>

using namespace std;

bool get_number ( int& number )
{
  while ( !( cin>> number ) ) {
    if ( cin.eof() )
      return false;
    else {
      char ch;

      cin.clear();

      cout<<"Invalid input, please try again: ";
      while ( cin.get ( ch ) && ch != '\n' )
        ;
    }
  }

  return true;
}

int main()
{
  int number;

  while ( get_number ( number ) ) …
Dave Sinkula commented: A little harsh on the admin, but a good thorough explanation and solutions nonetheless. +1
Narue 5,707 Bad Cop Team Colleague

>difference between c and c++ languages
++

>difference between templates and class, and structures and templates
There's no comparison, the two solve different problems.

>structures in c language and class
C structures have fewer features.

>difference between java and c++
A world.

>explain memory allocation in c asnd c++
Ask for memory and then use it. In C the most common way is

p = malloc ( n * sizeof *p );

or

p = malloc ( sizeof *p );

And in C++ the equivalent is

p = new type[n];

or

p = new type;

>explain what is procedural language as well as object oriented language distinctly in simple words
Procedural language: Do this, then this, then this until the problem is solved.
OO language: Use these objects to solve the problem.

So...at what point do you plan on doing your own research? People won't always hand out the answers to you, so it would be a good idea to get into the habit of reading and searching for information that you want rather than just posting your (vague and thus difficult to answer properly or concisely) questions and presumptuously expecting others to do your work for you.

alc6379 commented: VERY good post! +3
Narue 5,707 Bad Cop Team Colleague

>What I'm having trouble with is figuring out a way to keep track of which numbers were entered.
You're on the right track with this:

int num[1];

An array of one is pretty useless, but if you change that to, say 10, you can use j to figure out how many numbers there were and another index to print them:

for ( int i = 0; i < j; i++ )
  cout<< num[i] <<endl;
Narue 5,707 Bad Cop Team Colleague

>Is it possible to open notepad and type some gibberish and save it as a .exe file and run it?
If you want to work out the machine code for your system that would be equivalent for a properly assembled executable, then figure out what combination of keyboard characters will give you that machine code...I suppose it might be possible to do this if Notepad doesn't add anything in the process of saving the file as an executable.

Narue 5,707 Bad Cop Team Colleague

>Is it possible to create programmes to run on coumputers thad do not have any operating systems?
No, since to do so would require you to write an operating system to some extent.

Narue 5,707 Bad Cop Team Colleague

>2. Using a pointer to simulate pass by reference.
Much better. ;)

>Too late(?)
Better late than never.