Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
QuestResp
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//gcc 7.4.0 //QuestResponse: example of array of pointers and function pointer //this code is created by Rezaul Hoque on March 29,2022; //contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <stdio.h> #include <stdlib.h> #include <string.h> int question (); void response(int (*)()); int question (){ char q[30]; scanf("%s",q); int index,s; s=strlen(q); index=s%3; return index;} void response (int (*fp)()) { fp=question; int index; index=(*fp)(); char* r[3]={"Yes","No","Sometimes"}; printf(r[index]); } int main(){ question(); response(question); return 0; }
gcc
Do you play football?
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
edit mode
|
history
|
discussion