473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

A question about arrays.

In this function:

int f() {
int A[];
// TODO...
}

What is the use of A? How to assign memory to A? and how to use it later?
Jul 22 '05 #1
4 1170
Bilal Sallakh wrote:
In this function:

int f() {
int A[];
// TODO...
}

What is the use of A?
None.
How to assign memory to A?
Not.
and how to use it later?


You can't. The above should produce a compile error. You're trying to
create an array that has no size.

Jul 22 '05 #2
"Bilal Sallakh" <af***@mail2world.com> wrote in message
news:d5**************************@posting.google.c om...
In this function:

int f() {
int A[];
// TODO...
}

What is the use of A?
Invokes translator diagnostic.
How to assign memory to A?
int A[some_constant_expression];

or

int *A = new A[some_size];
and how to use it later?


Use it for what?

Which C++ book(s) are you reading?

-Mike
Jul 22 '05 #3
In turbo C++ from Borland Version 1 1990, a .c file raised a compile
time error while a .cpp file didn't. Is this up to the Compiler used?
Jul 22 '05 #4
If you have a question that is not related to a thread, please don't
post it as reply to it.

Bilal Sallakh wrote:
In turbo C++ from Borland Version 1 1990, a .c file raised a compile
time error while a .cpp file didn't. Is this up to the Compiler used?


Yes.

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: KN | last post by:
I know both are pretty much the same and it comes down to personal choice. But I have to make the choice for the team. Things so far that I am considering 1. XML documentation in C# -- thats...
7
by: Aguilar, James | last post by:
Hello all, To begin, yes, this -is- a homework assignment. However, it is for my Algorithms class, and my instructor has given us explicit permission to use "expert" groups like newsgroups, so...
5
by: mhk | last post by:
Hi , is there any way to merge three sorted arrays into a sorted file, without using 4th array. i guess 3 way merge sort is the only option but i dont know its algorithem. can anyone tell me...
105
by: Christoph Zwerschke | last post by:
Sometimes I find myself stumbling over Python issues which have to do with what I perceive as a lack of orthogonality. For instance, I just wanted to use the index() method on a tuple which does...
36
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it...
11
by: hammad.awan_nospam | last post by:
Hello, I'm wondering if it's possible to do the following with Generics: Let's say I have a generic member variable as part of a generic class like this: List<DLinqQuery<TDataContext>>...
90
by: John Salerno | last post by:
I'm a little confused. Why doesn't s evaluate to True in the first part, but it does in the second? Is the first statement something different? False print 'hi' hi Thanks.
4
by: Jess | last post by:
Hello, I tried several books to find out the details of object initialization. Unfortunately, I'm still confused by two specific concepts, namely default-initialization and...
5
by: nembo kid | last post by:
In the following function, s shouldn't be a pointer costant (array's name)? So why it is legal its increment? Thanks in advance. /* Code starts here */ void chartobyte (char *s) { while...
7
by: myheartinamerica | last post by:
I was confused about part 2.6 in the comp.lang.c. FAQ. 2.6 ... <cut> Another possibility is to declare the variable-size element very large, rather than very small; in the case of the above...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.