473,406 Members | 2,816 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,406 software developers and data experts.

Mixed Declaration Type Error

I'm unable to get my program to compile and have been working on it for hours now. The error I get is: error: ISO C90 forbids mixed declarations and code on line 47. My code is as follows:


full code removed per FAQ
Apr 2 '07 #1
8 1927
sicarie
4,677 Expert Mod 4TB
Can you post what is on line 47 for us, along with their declarations?
Apr 2 '07 #2
sicarie
4,677 Expert Mod 4TB
BTW- here are our Posting Guidelines and FAQ please keep them in mind when 1) posting code snippets 2) using code tags 3) creating descriptive titles. I have changed the title of this thread to reflect the question, but will change it again if needed.

Thanks!
Apr 2 '07 #3
::code removed, again, per FAQ::

I'm using visual C++ and pico as my editors and compiling using gcc. Thanks.
Apr 2 '07 #4
sicarie
4,677 Expert Mod 4TB
::code removed, again, per FAQ::

I'm using visual C++ and pico as my editors and compiling using gcc. Thanks.
Please read the Posting Guidelines, and my request. Please do not post your full code, but rather the line you are aware of with the problem - in this case 47, and the declarations of the variables used on line 47.
Apr 2 '07 #5
line 47 is as follows:
Expand|Select|Wrap|Line Numbers
  1.     /* Declare Arrays */
  2.     double x[ARRAY_SIZE]; /* Load on spring */
  3.     double y[ARRAY_SIZE]; /* Resulting deflection */
  4.  
ARRAY_SIZE is defined to be 50 before the main using #define
Apr 2 '07 #6
sicarie
4,677 Expert Mod 4TB
line 47 is as follows:
Expand|Select|Wrap|Line Numbers
  1.     /* Declare Arrays */
  2.     double x[ARRAY_SIZE]; /* Load on spring */
  3.     double y[ARRAY_SIZE]; /* Resulting deflection */
  4.  
ARRAY_SIZE is defined to be 50 before the main using #define
From what I'm finding in google, your compiler is apparently holding steadfastly to an ANSI C (ISO C90) standard, and does not allow variables to be declared once you begin coding. Try moving them to the top, see if that works.
Apr 2 '07 #7
I'm now able to get my program to compile. Thank you for your help and sorry for the trouble with my previous posts.
Apr 2 '07 #8
sicarie
4,677 Expert Mod 4TB
I'm now able to get my program to compile. Thank you for your help and sorry for the trouble with my previous posts.
It's ok, we're just trying to keep the site running smoothly and help people ask in the way that is most likely to return a response.

Glad it works, please post again if you get stuck!
Apr 2 '07 #9

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

Similar topics

6
by: andrewcw | last post by:
I have an object that serializes back and forth. I would like to have some objects not serialize ..and when I read that info back into the class, have this item be null ( or something like it ). ...
3
by: Chris Ellis | last post by:
Hi, I'm not sure if this is the right newsgroup for this question. I'm not sure if the problem lies in C# or in C++, but I am working on a project that uses a mixed-mode C++ dll to wrap some...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
0
by: Russ Barrett | last post by:
Hello, I'm new to ASP.Net and I'm trying to interface an ASP.Net (C#) application to functionality resident in a C++ static lib. From posts I've seen around I understand this requires creation of a...
1
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I have an VC++ MFC Win32 application that isn't working correctly when I build it with VS2005. The problem seems to be in some ADO ActiveX controls that came with VS6 and are now out of support....
7
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I'm new to working with mixed assemblies. All of my previous experience has been with VC++/MFC in native, unmanaged applications. When I create a mixed assembly in which one or more of the files...
6
by: samsneelam | last post by:
Hi.. This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob.. I am having two files .. one is mpcplib.h it contains the follwing...
10
by: tvnaidu | last post by:
I am using Three pthread functions below, I got ISO error, then I declared int variable called val123, then I assigned, but still I am getting error, any idea?. also I included pthread.h. compiling...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.