GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  PHP
Go To First  |  Previous Question  |  Next Question 
 PHP  |  Question 66 of 74    Print  
Calling C Function
How to call a C function within PHP?


  
Total Answers and Comments: 2 Last Update: April 22, 2009     Asked by: tonmoytewary 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 12, 2009 03:23:21   #1  
vikas1284 Member Since: March 2009   Contribution: 2    

RE: Calling C Function
We can call some of the C functions from PHP
like printf() fputs() fwrite() fgetc() exit() and so many others.

but we cannot call all of C functions for example we cannot call initgraph() function that is a part of turbo C and I don't think that there is any way to call custom C functions from PHP.

Perhaps it will need a very high level of C programming to create DLLs and include them as a PHP module or PEAR or plugin or whatever suits good.

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 2Overall Rating: -2    
April 21, 2009 06:05:24   #2  
nigenet Member Since: April 2009   Contribution: 1    

RE: Calling C Function
This is not strictly true.

PHP has many native functions that have the same name as C functions and which act in similar ways but they are not C functions they are PHP functions.

 
Is this answer useful? Yes | No

 Related Questions

What is difference between require_once(), require(), include().Becouse above three function usely use to call a file in another file.

If you have to work with dates in the following format: "Tuesday, February 14, 2006 @ 10:39 am", how can you convert them to another format, that is easier to use?
The strtotime function can convert a string to a timestamp.A timestamp can be converted to date format. So it is best to store the dates as timestamp in the database, and just output them in the format 
Read Answers (2) | Asked by : bicu

How i will check that user is, logged in or not. i want to make it a function and i want to use in each page and after login i want to go in current page(same page. where i was working)

use of header() function in php 
Latest Answer : The header() function sends a raw HTTP header to a client.We can use herder() function for redirection of pages. It is important to notice that header() must be called before any actual output is seen. ...

we have fetch_array to fetch a row from a result set... in what way the fetch_object function is useful... at which situation it is used? every question is like what is the difference and the answers is 
Latest Answer : Procedural programmers do use functional and OOPs programmers use class and objects.So it's just a facility and not a burden on anybody. If you're following OOPs pattern then you may use mysql_fetch_object function, otherwise get ...

How to call a C function within PHP? 
Latest Answer : This is not strictly true.PHP has many native functions that have the same name as C functions, and which act in similar ways, but they are not C functions, they are PHP functions. ...


 Sponsored Links

 
Related Articles

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Function Passing Types

C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
 

What is DECODE function used for?

DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What is the default return value of a function?

The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.   When a programmer wants other than integer values to be returned from function then it is essential that the pro
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(“%d”,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape