Indeed CUDA is only for nVidia cards. I suggest better using OpenCL. Also if these calculations is only for computing image transformations- you can try Pixel Shader.

Write GUI which generates other GUIs on GUI demand.

If number of permutations is not big - simply try to bruteforce. Otherwise try genetic algorithm - it is good for such sort of optimization problems.

[QUOTE=moroccanplaya;1245276]so why c is no used in the mainstream ?[/QUOTE]
"mainstream" alone doesn't mean anything at all and should be used only in context.

For example:

  • Embedded systems programming - C is used by mainstream.
  • GPU programming - take a look at GLSL shader language, which is based on C, - C is mainstream answer here.

So one need to choose particular field and after that search mainstream language in THAT field.

Please post code with code tags... It's hard to notice something without code tags.
Ok, now about code. Here is some redundant code here:
[CODE=C#]
//If depth charge dropped and ship is facing right...
if(_drop && ship.FlipHorizontally == false)
{
X = ship.X - 50;
Y = ship.Y;
Angle = 0;
Velocity = VELOCITY_IN_AIR;
Rotation = -DEPLOY_ROTATION;
Scale = 0.3;
Show = true;
_state = IN_AIR;
}

//If depth charge dropped and ship is facing left...
if (_drop && ship.FlipHorizontally == true)
{
X = ship.X + 50;
Y = ship.Y;
Angle = 0;
Velocity = VELOCITY_IN_AIR;
Rotation = DEPLOY_ROTATION;
Scale = 0.3;
Show = true;
_state = IN_AIR;
}
[/CODE]
Can be written in more laconic form as:
[CODE=C#]if (_drop)
{
int direction = ((ship.FlipHorizontally)? 1:-1);
X = ship.X + 50 direction;
Y = ship.Y;
Angle = 0;
Velocity = VELOCITY_IN_AIR;
Rotation = DEPLOY_ROTATION
direction;
Scale = 0.3;
Show = true;
_state = IN_AIR;
}[/CODE]

Next - You can in principle live without [ICODE]ship.FlipHorizontally[/ICODE] property. All you need is object's position and speed. That's all. So instead of
[ICODE]ship.FlipHorizontally?[/ICODE] you could use [ICODE]ship.VelocityX > 0 ?[/ICODE]

Your description of problem is too fuzzy. At first try to abstract from details and tell us in general - What are you trying to achieve here ?

[QUOTE=bobyx;1213834]Hi.Thanks a great.But how about these error messages,please;

1)extern int adcvalmax[8]= {0,0,0,0,0,0,0,0};// 43 1504 [B]Initialization [/B][B]of extern object 'adcvalmax' t1x.c//[/B]
[/QUOTE]
You get "Initialization of extern object xxx" error because you try to initialize extern object which is already initialized. So double initialization is not legal. So if you want to re-fill zeros of adcvalmax array - do something like instead:

[CODE=C]
memset(adcvalmax,0,8*sizeof(int));
[/CODE]
Or just use loop to re-assign zeros to each element. But memset maybe more effective.

I am too tired to analyze rest errors ;)

[QUOTE=koved;1212935]i want to know what is the code written in header files.(how a functions works)
is that possible

for e.g.
i created my own version of [U]sqrt[/U] function in .C
now i want to know the difference b/w my code and sqrt function code.
i want to check how efficiently i created it.

thnks[/QUOTE]
You don't need sqrt source to compare your own implementation efficiency. Just run math.h sqrt in a loop - record total calculation time.
do the same thing with your sqrt - then compare execution times. Of course all conditions should be equal, that is - run experiment on same argument values and etc. Also you can compare calculation precision.

I will suggest 3 ways:

[ICODE]Easy[/ICODE] => Python and PyGame (or even Rabbyt - easier library for 2D stuff)
[ICODE]Normal[/ICODE] => C# / VB.NET and XNA (xna is very good directx abstraction library)
[ICODE]Hard[/ICODE] => C++ and DirectX SDK (hard way, if you want to control everything and are prepared for that).

And of course there are many many unmentioned different ways to get there. So start at easy way, make several projects and move on to next level.

Good luck.

bperiod commented: Yes, it's ok. I suggested Pascal for absolutely beginners. But this's better. +1

[QUOTE=tquiva;1193809]But why am I getting a cosine value of 2.4653 for an input of 2?[/QUOTE]
As jephthah explained - that is a property of Taylor series approximation. If you want some continuous approximation (which doesn't have increasing error) then you must use some other polynomial approximations - for example by using quadratic curve approximation or etc. =>
[url]http://www.devmaster.net/forums/showthread.php?t=5784[/url]
[url]http://lab.polygonal.de/2007/07/18/fast-and-accurate-sinecosine-approximation/[/url]

Good luck!

jephthah commented: good links +7

[QUOTE=UncleLeroy;1190470]Oops, it works when the array is part of a structure or union.
[CODE]
struct {
int elem[10][100];
} array1, array2;

main()
{
array1.elem[0][0] = 1;
array1.elem[9][99] = 9;
array2 = array1;
printf("%d %d\n", array2.elem[0][0], array2.elem[9][99]);
}

[/CODE][/QUOTE]
Yes, such copy is working. But... don't you think that your solution misses the question, because question is about copying arrays, not structures. :) . Whatever...

jephthah commented: i thought the same thing. +7

[QUOTE=Ancient Dragon;1190476]>>Besides notations "array[5]" and "*(array+5)" are EQUAL. So it can be safe to say that when we accessing array element - we are actually doing pointer arithmetics.

Not really. [b]array[/b] can not be incremented like a pointer, so it's not a pointer. You can't do [icode]array++;[/icode] in the same function as where the array was originally declared.[/QUOTE]
Where i said that array IS pointer ? That's one point. Second point is that it is true what you said. For that reason I call array - "static address" and pointer - "dynamic address". But they both represent ADDRESSES to memory. So they has differences, but also similarities too.

Ancient Dragon commented: Agree +28

Hm... then print source array on paper and write destination array with pencil yourself :twisted:

I bet that you want to use power function instead of XOR operator, something like:

[CODE]

include <math.h>

float key_magic = pow(2., 1./12.);
[/CODE]