Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:05:47+00:00 2026-06-18T05:05:47+00:00

How to get float array from the function fann_run() This the C version of

  • 0

How to get float array from the function fann_run()

This the C version of it.

fann_type *calc_out;
fann_type input[2];
struct fann *ann = fann_create_from_file("xor_float.net");
input[0] = -1;
input[1] = 1;
calc_out = fann_run(ann, input);
printf("xor test (%f,%f) -> %f\n", input[0], input[1], calc_out[0]);
fann_destroy(ann);

I am trying to this in c#

[DllImport("fannfloat.dll", EntryPoint = "fann_run")]
public static extern IntPtr fann_run(IntPtr _ann, float[] _input);

IntPtr ann = FANN.fann_create_from_file("Arial.net");
IntPtr result = FANN.fann_run(ann,input600);

Now i want to access the floats using ‘result’.
How can i do this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:05:48+00:00Added an answer on June 18, 2026 at 5:05 am

    You can use the Marshal.Copy Method to copy the values from unmanaged memory into a managed array if you know the number of elements:

    float[] output = new float[7];
    Marshal.Copy(result, output, 0, output.Length);
    

    Don’t forget to free result when you’re done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the values from a pointer to a float array, but
I wrote this function to get a pseudo random float between 0 .. 1
I have a float array that I get from a sensor and want to
How can I get a random float value from /dev/urandom ? If I simply
this is from the source code of csv2rec in matplotlib how can this function
I've passed a 2D array from a C++ class to a CUDA function; however,
I am trying to pass a ruby array from one C function to another
I would like to get a byte[] from a float[] as quickly as possible,
I need to get the decimal part out of a float number, for example:
I want to get table metadata for all table columns. Like type string(varchar2)/int/float/datetime and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.