Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
c++ pointer
SUBMITTED BY:
Guest
DATE:
Oct. 13, 2013, 3:28 a.m.
FORMAT:
C++
SIZE:
469 Bytes
Raw
Download
Tweet
HITS:
1903
Go to comments
Report
// increaser
#include
<iostream>
using
namespace
std
;
void
increase
(
void
*
data
,
int
psize
)
{
if
(
psize
==
sizeof
(
char
)
)
{
char
*
pchar
;
pchar
=
(
char
*
)
data
;
++
(
*
pchar
);
}
else
if
(
psize
==
sizeof
(
int
)
)
{
int
*
pint
;
pint
=
(
int
*
)
data
;
++
(
*
pint
);
}
}
int
main
()
{
char
a
=
'x'
;
int
b
=
1602
;
increase
(
&
a
,
sizeof
(
a
));
increase
(
&
b
,
sizeof
(
b
));
cout
<<
a
<<
", "
<<
b
<<
endl
;
return
0
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus