Hi,
I am declaring an array which carries x coordinates, however these will vary depending on the geometry the user enters.
I have set my code up as follows, but get the "initialize r element not constant" issue. I had the code compiling earlier, but made the mistake of moving thing aorund without taking a backup and now nothing works!
Any help would be greatly appreciated.
/*============== =============== =============== ===========*/
#include <stdio.h>
#include <stdlib.h>
#include <grx20.h>
/*Declare types of parameters entered */
float x1, x2, x3, yone, y2, y3;
float x23;
int NoMembers, NoNodes;
main()
{
x1 = 4;
x2 = 2;
x3 = 6;
yone = 4;
y2 = 10;
y3 = 14;
x23 = 6;
}
float x1co[] = {-x1, x1, x1, -x23, -x23, x23, x23, -x2, x2, x2, -x3, -x2, x2, x3};
/*============== =============== =============== ======*/
3 2257
Well everything I'm seeing here should work fine, so the problem's most likely in a part of your program that is not posted here.
Thanks for the help, I copied it into another source file and it compiled no problem! Thanks anyway!
JosAH 11,448
Recognized Expert MVP
Thanks for the help, I copied it into another source file and it compiled no problem! Thanks anyway!
That wasn't the problem: the first time you tried to compile it as if it were a C file;
the last time you used a C++ compiler.
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Barry |
last post by:
Hi group,
Does anyone know why I get a W3 validator error (click the validation
link at the bottom of the page) for
http://www.polisource.com/consumer-protection.shtml saying "Line 227,
column 3: end tag for element "P" which is not open." It looks open to
me, right before the table tag. Maybe that's why the validator is still
in beta, but I thought I'd ask.
|
by: Todd Nathan |
last post by:
Hi. have this code and compiler problem. GCC 2.95.3, BeOS, error
"initializer element is not constant"
#ifdef FILEIO
{ static struct {
char *sfn;
FILE *sfd;
} stdfiles = {
|
by: Player |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello all.
I am in the process of teaching myself C# and I think I am doing OK.
I have learnt how to how to call the right constructor of a class, if the
class has more than than one cosntructor, by making sure that each
constructor has a different signature. I have managed to learn that and get
|
by: emin.martinian |
last post by:
When trying to compile python extensions written in C using "python
setup.py build" on cygwin I get the following error:
foo.c: initializer element is not constant
foo.c: error: (near initialization for `FooType.ob_type')
I remember someone telling me a long time ago that this had something
to do with declspec and how dlls are imported on cygwin/python. Can
someone give me a pointer to how to build python extensions on cygwin?
|
by: tankbattle |
last post by:
That is, what's the difference between
<complexType name="Address" final="restriction">
<sequence>
<element name="name" type="string"/>
<element name="street" type="string"/>
<element name="city" type="string"/>
</sequence>
</complexType>
and
<complexType name="Address" block="restriction">
| |
by: pirunnyrkki |
last post by:
Being utterly useless when it comes to JavaScript, I come here for help with an issue that may or may not be an actual problem.
Say for example that I have a link that looks like thus:
<a href="language/lordprayer.html" title="A translation of the Lord's Prayer into Nordaþ and other Germanic languages in a side-by-side comparison">The Lord's Prayer</a>
Is there a way that I can take this title attribute show up under the...
|
by: jaime |
last post by:
Hi again all.
Given the line:
const int x=5;
Can I then use "x" as a constant expression? (By "constant expression", I
mean "constant expression" as defined in the C99 standard)
I've been searching google for 2 days now trying to answer this myself,
and I'm just getting more and more confused (some things I read make me
think "yes", while some things I read make me think "no").
|
by: hankypan1 |
last post by:
Hi All,
I need a tree data structure for my application. It is the non -
cyclic
simple tree where i can have any number of children node and each
child can recursively become a sub tree like a normal tree. Now the
thing is i can popullate my tree at compile time like a global data.
Since
i know my tree definition at compile time, instead of using pointers
to point to siblings or child nodes, i am planning to use the array
|
by: bobg.hahc |
last post by:
running access 2k;
And before anything else is said - "Yes, Virginia, I know you can NOT
use a variable to set a constant (that's why it's constant)".
BUT - my problem is - I want a constant, that I can set from a
variable (one time)!!!
When my application starts, the user is prompted to make a selection
from a list.
I want that selection to go into a global variable, and NEVER CHANGE
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |