Search found 40 matches

by raysa
Wed May 31, 2006 11:23 am
Forum: C++
Topic: Float-type Array Index (Error:Illegal use of floating point)
Replies: 11
Views: 3924

it's all OK now.
Thank you everyone.. Especially you, Moha!
Your code WORKS like charm! :wink:
by raysa
Mon May 29, 2006 8:24 pm
Forum: C++
Topic: Float-type Array Index (Error:Illegal use of floating point)
Replies: 11
Views: 3924

This is weird...
I can retrive y[1.5] value using y[1.8] call.

Code: Select all

printf ("y = "); scanf ("%lf",&y[I(1.5)]);
printf ("y = %lf\n", y[I(1.8)]);
How to fix this modifying Moha's hash?
by raysa
Mon May 29, 2006 5:33 pm
Forum: C++
Topic: Float-type Array Index (Error:Illegal use of floating point)
Replies: 11
Views: 3924

Nevermind. It's my mistake.
I was putting a semicolon behind the #define syntax.

Anyway, please tell us what your code does...
What part in your code is to modify the number of digits after decimal point?

Thank's,

raysa
by raysa
Mon May 29, 2006 5:14 pm
Forum: C++
Topic: Float-type Array Index (Error:Illegal use of floating point)
Replies: 11
Views: 3924

Thank's A1, mf and Moha for the insights!

@Moha
Can you tell us what your code do?
I'm applying your code in my listing:

Code: Select all

scanf ("%f",y[I(1.5)]);
but it got "Subscripting missing: ]" and "Expression syntax" error.

I can't see any typo in the syntax. Any thought?
by raysa
Mon May 29, 2006 1:37 pm
Forum: C++
Topic: Float-type Array Index (Error:Illegal use of floating point)
Replies: 11
Views: 3924

Float-type Array Index (Error:Illegal use of floating point)

Hi, I need to do a very simple task like: y[0.5] = 1; y[1.5] = 2; y[2.5] = 3; but I always get "Illegal use of floating point" error message. It seems like the array index should only contain a solid integer. Is there any way to do that type of array assignment (float-type of array index)? Any help ...
by raysa
Sun May 28, 2006 2:58 pm
Forum: C++
Topic: <float>^<float>: Illegal Use of Floating Point
Replies: 2
Views: 2266

Solved that way.
Thank you, mf! Really appreciate it.
by raysa
Sun May 28, 2006 12:55 pm
Forum: C++
Topic: <float>^<float>: Illegal Use of Floating Point
Replies: 2
Views: 2266

<float>^<float>: Illegal Use of Floating Point

Hi, I got the error "Illegal Use of Floating Point" when I put in a formula like: float result = 0.3^0.5; float result = 0.3^5; float result = 3^0.5; I really need to do this kind of calculation but couldn't figure out what data-type should it take to proceed a formula in <float>^<float> form. I've ...
by raysa
Tue Apr 08, 2003 6:45 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 30990

Just found my mistake: I used same array of char for the index and the elements. I've NULL-ed the array after inputting the index, but forgot doing so for the elements... It surely messed up the next inputs and cause an RTE. AC now... Anyway, thank's for your help, Turuthok! Really apreciate it... :...
by raysa
Sat Apr 05, 2003 3:01 pm
Forum: C++
Topic: function's return value
Replies: 4
Views: 2244

Thank's! Now I want to know how we read integers using "scanf" until the end of line or when the newline('\n') is reached... example: 2 5 1 2 3 4 5 consists of 2 inputs: integers in the first line and in the second line. How can we separate it without taking it as 2 different string inputs <with 'ge...
by raysa
Sat Apr 05, 2003 1:50 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 30990

I thought so. I took the number of cases first before continue processing input. Is there anything wrong with my m_input handling in my code above? Can m_input cause an RTE?

Regards,
Raysa
by raysa
Fri Apr 04, 2003 3:01 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 30990

482 - Help me get a WA!

Hi,
Sorry to post my code here, but I really have nothing else to do to get out of this annoying RTE<SIGSEGV>. Off course, I did grow my array size but I don't think it would help at all. Someone, please gimme a hint to get a WA...

[cpp]---CODE WAS CUT---[/cpp]

Thank's :oops:
Raysa
by raysa
Thu Apr 03, 2003 4:59 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 24973

Thank's angga888!
I grew mine to 1200000 and finally got AC! :D

Regards,
Raysa
by raysa
Thu Apr 03, 2003 4:54 pm
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 19438

Sorry to interrupt, but I just last my WA's by replacing NULL string '\0' with whitespace...
They really make me think that they ARE right, Dominik!
Thank's to Hisoka and Little Joey... :D

Regards,
Raysa
by raysa
Fri Mar 21, 2003 7:44 pm
Forum: C++
Topic: function's return value
Replies: 4
Views: 2244

function's return value

Hi again! It's about function in C++... I'm just not familiar with it! Can you tell me why my code below doesn't hit my purpose <to swap two integers> : [cpp]#include <stdio.h> int i,j,temp; int swap(int a, int b) { temp=a; a=b; b=temp; return (a,b); } void main() { int i,j; i=1; j=2; swap (i,j); }[...
by raysa
Thu Mar 20, 2003 4:17 pm
Forum: Volume 7 (700-799)
Topic: 782 - Contour Painting
Replies: 53
Views: 21849

Fixed, but still Still WA <0.361 sec>... After expanding the NULL with white space, do we have to return it to it's original form before printing? So, what's the output for: ______ bbbbbb b b b ______ bbbbbb b b* b ______ with b represents white space? <Please answer also with b-represented white sp...

Go to advanced search