Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 24th, 2006, 8:06 PM   #11
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,209
Rep Power: 5 grumpy is on a distinguished road
Not sure about government generally, but the reason US DoD mandated ada was because they had put a lot of effort into developing it as a means of addressing many common problems. Security was only one of those: the more dominant concern was being able to have a program that is more likely to demonstrably work correctly. The catch, and the reason they have backed away from only mandating Ada, is that measurable productivity was not particularly high. Particularly with educational institutions moving more towards teaching "flavour of the month" languages rather than teaching basic software engineering principles. Ada is a challenging language to learn from day 1, as it requires such skills, so it became tough to find people with skills who could be trained so they become an Ada person, let alone find people who actually knew Ada. The fact that early versions of Ada were large complex languages and dropped in place quickly (rather than growing over a period of time, as far as industry usage is concerned) meant a fair amount of pain for industry to adopt Ada.

A lot of US DoD work is being done in C++ now. C++ is also a challenging language to learn but, unlike Ada, it grew over time from it's C roots (and C already had a good foothold) and therefore the process of creating C++ resulted in a solid uptake by industry. Which means that there is more incentive for people to learn C++, so it is easier to find/grow people with appropriate skills, etc etc.
grumpy is offline   Reply With Quote
Old Jun 24th, 2006, 8:24 PM   #12
Dragon_Master
Programmer
 
Dragon_Master's Avatar
 
Join Date: Jan 2006
Location: Some where
Posts: 74
Rep Power: 3 Dragon_Master is on a distinguished road
Dunno... I found C++ easy to learn... But then again I learned asm first...
Dragon_Master is offline   Reply With Quote
Old Jun 25th, 2006, 12:48 AM   #13
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,209
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by Dragon_Master
Dunno... I found C++ easy to learn... But then again I learned asm first...
In my experience, most people who found C++ easy to learn only use a small part of the language, and only a small part (if any) of the STL, and rarely have a solid appreciation of techniques (eg idioms, design techniques) necessary to get most value from the language. The fact that (in another thread) you mentioned you have rarely found a use for classes suggests you are only scratching the surface of C++.
grumpy is offline   Reply With Quote
Old Jun 25th, 2006, 1:01 AM   #14
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
wasn't ada actually named after a woman? (lady ada lovelace or something of that nature)

EDIT: sounds suspiciously like a porn star name
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Jun 25th, 2006, 1:22 AM   #15
Adak
Hobby Coder
 
Join Date: May 2006
Posts: 57
Rep Power: 0 Adak is an unknown quantity at this point
Quote:
Originally Posted by bl00dninja
wasn't ada actually named after a woman? (lady ada lovelace or something of that nature)

EDIT: sounds suspiciously like a porn star name
She was a very smart woman, trained in both literature and mathematics, and quite skilled in the latter, especially. Very rare in Victorian England.

IIRC she was a confidant of Charles Babbage, designer/inventor of the "inference engine". I'm sure Wiki has an entry for her.

Adak
Adak is offline   Reply With Quote
Old Jun 25th, 2006, 5:54 AM   #16
v0id
Hobbyist Programmer
 
Join Date: Apr 2006
Posts: 155
Rep Power: 3 v0id is on a distinguished road
Quote:
wasn't ada actually named after a woman? (lady ada lovelace or something of that nature)
Yeah, Augusta Ada King - or just Ada Lovelace.
Quote:
I'm sure Wiki has an entry for her.
http://en.wikipedia.org/wiki/Ada_Lovelace
v0id is offline   Reply With Quote
Old Jun 25th, 2006, 9:04 PM   #17
Dark Flare Knight
Hobbyist Programmer
 
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4 Dark Flare Knight is on a distinguished road
guys, back to the topic, could someone tell me how to allocate memory to a pointer?
Dark Flare Knight is offline   Reply With Quote
Old Jun 26th, 2006, 2:53 AM   #18
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,209
Rep Power: 5 grumpy is on a distinguished road
You don't "allocate memory to a pointer". The technique is to either initialise or assign the pointer so the value it contains is the address of some block of memory. There are several common techniques to do that.

One is to create an array;
   char data[100]
in which case data is the name of an array of 100 chars. By the rules of the language the name "data" may also be used as if it was a pointer to an array of 100 char. The catch with this approach (except in very recent C compilers, which comply with the 1999 standard) is that it requires you to know the length at compile time.

Another approach is the dynamically allocate memory. For example;
#include <stdio.h>
#include <stdlib.h>

int main()
{
     /* initialise data so it contains the address of some usable memory */
     char *data = malloc(100);    /* char *data = (char *)malloc(100); in C++ */
       /* all your other stuff  */
     free(data);
}
The advantage of this is that the amount of memory needed can be determined at compile time. The disadvantage is that you need to remember to release the memory (using free()) or you get a memory leak --- working out when you can or should release dynamically allocated memory can be difficult in complex programs.
grumpy is offline   Reply With Quote
Old Jun 26th, 2006, 10:11 AM   #19
Dark Flare Knight
Hobbyist Programmer
 
Join Date: Mar 2005
Location: Canada
Posts: 113
Rep Power: 4 Dark Flare Knight is on a distinguished road
thanks.
Dark Flare Knight is offline   Reply With Quote
Old Jun 26th, 2006, 11:57 AM   #20
Dragon_Master
Programmer
 
Dragon_Master's Avatar
 
Join Date: Jan 2006
Location: Some where
Posts: 74
Rep Power: 3 Dragon_Master is on a distinguished road
Quote:
In my experience, most people who found C++ easy to learn only use a small part of the language, and only a small part (if any) of the STL, and rarely have a solid appreciation of techniques (eg idioms, design techniques) necessary to get most value from the language. The fact that (in another thread) you mentioned you have rarely found a use for classes suggests you are only scratching the surface of C++.

No, I know how to use classes have used them, very successfully, but I just can't find a very pratical use for them. Most of the stuff I've doing lately is proof of concept for work. They ask for quick, code. They don't want me to fill it with anthing that distracts. Besides, I really don't need OOP to keep oraganized. I have programming in C for as long as I can remember. Plus, I started programming computers back when I was like 12, it was one othe first languages I learned. I've been doing it for like 20 or so years, I'd say I know fairly well, by now.
Dragon_Master is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC