473,513 Members | 4,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error] cannot convert 'float**' to 'float*' for argument '1' to 'void fill(float*, in

2 New Member
#include<stdio.h>

void fill(float *av,int *max,int *i,FILE *p,int n)
{
while(!feof(p))
{
*av+=n;
if(*max<n)
*max=n;
(*i)++;
}
*av=(n)/(*i);
fclose(p);
}


the call is{
p=fopen(fn,"r");
fill(&av,&max,&i,p,n);
fclose(p);
}
the message in the description keeps popping up.I tried changing almost everything, but nothing seems to work.i'd really appreciate it if you show me your guidance,for i'm a total beginner, started a month ago!!
May 1 '15 #1
3 10038
donbock
2,426 Recognized Expert Top Contributor
Please show us the definitions (types) for the variables being passed to fill when you call it.
May 1 '15 #2
donbock
2,426 Recognized Expert Top Contributor
My guess is av is defined as an array of floats. If so, then...
  • function1(av[0]) passes a single float value.
  • function2(av) passes a single float* value that points at the first element in the array.
  • function3(&av[2]) passes a single float* value that points at the third element in the array.
  • function4(&av) passes a single float** value that points to a pointer to the first element in the array.

float* is a pointer to a float variable.
float** is a pointer to a variable which in turn is a pointer to a float variable.

Click on the Articles tab and then look at the entry named Arrays Revealed for a much more complete explanation. (I can't seem to embed a link today.)
May 1 '15 #3
nicrochaos
2 New Member
solved it
turned out that the declaration was wrong,float *av
led to the float** issue, though i didn't know what the ** was about at first,so thanks for opening my eyes on the subject.
i really appreciate it.
May 1 '15 #4

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

Similar topics

1
3227
by: Sorisio, Chris | last post by:
Ladies and gentlemen, I've imported some data from a MySQL database into a Python dictionary. I'm attempting to tidy up the date fields, but I'm receiving a 'mx.DateTime.Error: cannot convert value to a time value' error. It's related to glibc returning an error to a pre-1970 date, I think. My question: /how/ do I go through the Python...
4
8302
by: royend | last post by:
Hi. I am having some strange troubles creating a dropdown menu at my toolbar. I have followed this tutorial: http://www.codejock.com/developer/article05.asp My problem occurs at this line: ON_NOTIFY(TBN_DROPDOWN, AFX_IDW_TOOLBAR, OnToolbarDropDown) which get the odd message: error C2440: 'static_cast' : cannot convert from 'void...
4
25021
by: Pixie Songbook | last post by:
Hi, I'm trying to write a program using the Dev C++ 4.9.9.2 compiler that takes input numbers from a word document, sums them together, and then gives me a result. It should be easy as the book I have tells me what to do, problem is I get the error message "cannot convert `float' to `float*' for argument `1' to `float array_sum(float*, int)' "...
2
13167
by: Frostmur | last post by:
Hi !! I'm trying to convert C code to C++. This is my function: static void (*selection)(void) = NULL; static void (*pick)(GLint name) = NULL; void zprSelectionFunc(void (*f)(void))
6
4427
by: puzzlecracker | last post by:
I call method Foo(string s); with Foo("foo"+"bar"); what's the deal here?
3
2860
by: Arepi | last post by:
Hi, The following class decide which type is in the current instance and itialize depends on this information. The problem: When make an instance with any pointer type, a compilation error occures: cannot convert from 'char' to '...*'. I thought might be a solvation that dont compile the char initialization part if a pointer type has...
1
6062
by: kyana | last post by:
can you help me with this error?'cpp cannot convert `float' to `double*' for argument #include <stdio.h> #include <stdlib.h> double f(double x,int a,int b,int c,int d); double formative(double x,int a,int b,int c); double Newton(double x);
1
5573
by: roverzon | last post by:
The compiler shows the error of cannot convert float to float at line 1. I don't know what's going on about this error. It is an easy program for calculating a distance between two point #include <stdio.h>
1
2835
by: HenriqueMelo | last post by:
#include <iostream> #include <string.h> #include <sstream> #include <cmath> using namespace std; struct leituras{ float vetor; int n; }n1; int quadrados(leituras n1, int i, float desvio_qualquer, float quadrados);
0
7178
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...
0
7397
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, 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. ...
0
7563
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
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...
0
7543
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 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...
0
5703
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
1612
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 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.