Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
TeleBook
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 //TeleBook: example of function returning a structure and function taking structure as parameter //this code is created by Rezaul Hoque on March 22,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> struct tele{ char name[80]; int num; }; struct tele f1(); void f2(struct tele t); struct tele f1(){ struct tele t; printf("Enter name and number: \n"); scanf("%s",t.name); scanf("%d",&t.num); return t; } void f2(struct tele t){ printf("name phone number \n"); printf("%s %d",t.name,t.num); } int main() { struct tele ad; ad=f1(); f2(ad); return 0; }
gcc
az 987654
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
edit mode
|
history
|
discussion