473,385 Members | 1,798 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,385 software developers and data experts.

gcc 3.4.4 and the c99 standard

I'm trying to write some c99 standard code and compile it with gcc 3.4.4 with the net beans IDE. To my surprise there are several features of the new standard that gcc does not support.

Does anyone know of a way to use variable length arrays using my current compiler?
Oct 15 '08 #1
3 3366
Laharl
849 Expert 512MB
See if you can find a way to use the -c99 flag. If this version of gcc doesn't support it, you'll need to upgrade. Or just use malloc for variable length arrays.
Oct 15 '08 #2
See if you can find a way to use the -c99 flag. If this version of gcc doesn't support it, you'll need to upgrade. Or just use malloc for variable length arrays.
First, thx for the reply. What is malloc and can I trigger the -c99 flag with a command line instruction?
Oct 15 '08 #3
Laharl
849 Expert 512MB
On the command line, when you use the gcc command, you can give it options, also referred to as flags or switches, by using -. For example, gcc -Wall file.c will compile file.c and link it into an executable called a.out and output any warnings the compiler sees (use of -Wall is good coding practice). In order to change the executable's name, you use the -o filename flag. So gcc -Wall -o exe file.c will create an executable called exe. For the c99 flag, you'd compile with gcc -Wall -o outfile -c99 infile.c. Check the man page for gcc (or Google) for more information, assuming you're on some version of Unix/Linux.

In Netbeans, there should be a dialog somewhere that lets you change the command used for compilation. I've never used this particular IDE for C/C++, just Java, but I know Visual Studio has it. Look in Project properties or Options, something like that.

As to malloc, it allows you to declare arrays of whatever length you want, but you have to free them once you're done with them with the free() function. Google for more information.
Oct 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: Magnus Lie Hetland | last post by:
Is there any interest in a (hypothetical) standard graph API (with 'graph' meaning a network, consisting of nodes and edges)? Yes, we have the standard ways of implementing graphs through (e.g.)...
6
by: John Bentley | last post by:
John Bentley writes at this level: If we think about our savings accounts then division never comes in (as far as I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
29
by: David Eng | last post by:
In replying to P.J. Plauger (...
43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
52
by: lovecreatesbeauty | last post by:
Why the C standard committee doesn't provide a standard implementation including the C compiler and library when the language standard document is published? C works on the abstract model of low...
24
by: noridotjabi | last post by:
Why isn't there a Graphical User Interface standard? Think about it for a second. You may say, well evey systems API for GUIs is differnt, but do take into acound: every operating system requires...
132
by: Frederick Gotham | last post by:
If we look at a programming language such as C++: When an updated Standard comes out, everyone adopts it and abandons the previous one. It seems though that things aren't so clear-cut in the C...
1
by: manish deshpande | last post by:
Hi, When i'm installing MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm by the following command: rpm -i MySQL-server-standard-5.0.24a-0.rhel3.i386.rpm the following error is being shown: ...
26
by: Rick | last post by:
I'm told that "#pragma once" has made it into the ISO standard for either C or C++. I can't find any reference to that anywhere. If it's true, do any of you have a reference I can use? ...
270
by: jacob navia | last post by:
In my "Happy Christmas" message, I proposed a function to read a file into a RAM buffer and return that buffer or NULL if the file doesn't exist or some other error is found. It is interesting...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.