473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

passing function with argument to function?

21
Hi I'm getting some errors, xxx is not a function.

I'm sending a function as an argument to a funtion:
Expand|Select|Wrap|Line Numbers
  1. function s(x)
  2. {
  3.  ....
  4. }
  5.  
  6. function t(a,b,c)
  7. {
  8.  .......
  9. }
  10.  
  11. When passing s into t I get the error s is not a function
  12.     Expand|Select|Wrap|Line Numbers
  •  
  •     
  •  
  • t(y,ys,s('45'))
  • or 
  • t (y,ys,s(45))
  •  
  •  
  •     
  •  
  •  
  •  
  •  
  • Apr 16 '07 #1
    3 1573
    acoder
    16,027 Expert Mod 8TB
    If it's expecting a function, then passing a function with an argument will give the result of that function.
    Apr 16 '07 #2
    acoder
    16,027 Expert Mod 8TB
    If it's expecting a function, then passing a function with an argument will give the result of that function, or the function has not been defined properly. Check for errors in the actual function (s).
    Apr 16 '07 #3
    moho
    21
    I tried an different approach, I forgot to say that it was in html so probably that's why there where problems. with () inside a function call.
    Apr 17 '07 #4

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

    Similar topics

    3
    by: domeceo | last post by:
    can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
    58
    by: jr | last post by:
    Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
    1
    by: Foxy Kav | last post by:
    Hi everyone, im a first year UNI student doing a programming subject and im stuck on how to get rid of my global variables, char stringarray and char emptystring. I was wondering if anyone could...
    25
    by: Victor Bazarov | last post by:
    In the project I'm maintaining I've seen two distinct techniques used for returning an object from a function. One is AType function(AType const& arg) { AType retval(arg); // or default...
    39
    by: Mike MacSween | last post by:
    Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down...
    17
    by: Charles Sullivan | last post by:
    The library function 'qsort' is declared thus: void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); If in my code I write: int cmp_fcn(...); int...
    3
    by: sd2004 | last post by:
    I am still learning, could someone show/explain to me how to fix the error. I can see it is being wrong but do not know how to fix. could you also recommend a book that I can ref. to ?...
    1
    by: User1014 | last post by:
    Since you can pass a function to a ... erm...... function.... how to you use the result of a function as the argument for another function instead of passing the actual function to it. i.e. ...
    12
    by: dave_dp | last post by:
    Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
    18
    by: sanjay | last post by:
    Hi, I have a doubt about passing values to a function accepting string. ====================================== #include <iostream> using namespace std; int main() {
    0
    by: emmanuelkatto | last post by:
    Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
    0
    BarryA
    by: BarryA | last post by:
    What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
    1
    by: nemocccc | last post by:
    hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
    0
    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...
    0
    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,...
    0
    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...
    0
    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...
    0
    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,...
    0
    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...

    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.