1. C question...
- Posted by PQ <quistnet at HOTMAIL.COM>
Jan 05, 2000
-
Last edited Jan 06, 2000
------=_NextPart_000_0025_01BF57CA.F4436110
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hy,
I'm not new with Euphoria, but with C/C++
and since I was so stupid enough to learn the easy programming first, =
named Euphoria, I'm getting lazy to learn C/C++ wich I now find very =
difficult.
My question was, if there is a way to create unpredictable sequences =
like in EU.
I mean, how can this be possible in C:
sequence tmp
tmp=3D{ {}, {{},{}}, {}...}
tmp[2]=3D{{},{},{},1}
Those unpredictable kind of things, can it be done with C/C++
I tried, but...
Also tried it with placing at the beginning of a program: char tmp[]
that works a little, but thats not possible within a function.
Even tried: unsigned long char tmp[]
Can anyone give an example on how to do all of this, in a C or C++
program, with a function returning a sequence and the procedure =
processing this sequence ?
Thanks,
PQ
QC
------=_NextPart_000_0025_01BF57CA.F4436110
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hy,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm not new with Euphoria, but with=20
C/C++</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>and since I was so stupid enough to =
learn the easy=20
programming first, named Euphoria, I'm getting lazy to learn C/C++ wich =
I now=20
find very difficult.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My question was, if there is a way to =
create=20
unpredictable sequences like in EU.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I mean, how can this be possible in =
C:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> sequence =
tmp</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> tmp=3D{ {}, {{},{}}, =
{}...}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
tmp[2]=3D{{},{},{},1}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Those unpredictable kind of things, can =
it be done=20
with C/C++</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I tried, but...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Also tried it with placing at the =
beginning of a=20
program: char tmp[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>that works a little, but thats not =
possible within=20
a function.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Even tried: unsigned long char =
tmp[]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone give an example on how to do =
all of=20
this, in a C or C++</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>program, with a function returning a =
sequence and=20
the procedure processing this sequence ?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PQ</FONT></DIV>
------=_NextPart_000_0025_01BF57CA.F4436110--
2. Re: C question...
- Posted by JJProg at CYBERBURY.NET
Jan 05, 2000
-
Last edited Jan 06, 2000
EU>Hy,
EU>I'm not new with Euphoria, but with C/C++
EU>and since I was so stupid enough to learn the easy programming first, named
EU>My question was, if there is a way to create unpredictable sequences like in
EU>I mean, how can this be possible in C:
EU> sequence tmp
EU> tmp={ {}, {{},{}}, {}...}
EU> tmp[2]={{},{},{},1}
EU>Those unpredictable kind of things, can it be done with C/C++
EU>I tried, but...
EU>Also tried it with placing at the beginning of a program: char tmp[]
EU>that works a little, but thats not possible within a function.
EU>Even tried: unsigned long char tmp[]
EU>Can anyone give an example on how to do all of this, in a C or C++
EU>program, with a function returning a sequence and the procedure processing t
EU>Thanks,
EU>PQ
EU>QC
It is possible, but it's not built-in. You'd probably have to write your
own functions to automatically resize and subscript sequences etc.
Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/
3. Re: C question...
> EU>My question was, if there is a way to create unpredictable
> sequences like in
> EU>I mean, how can this be possible in C:
> EU> sequence tmp
> EU> tmp={ {}, {{},{}}, {}...}
> EU> tmp[2]={{},{},{},1}
> EU>Those unpredictable kind of things, can it be done with C/C++
> EU>I tried, but...
> It is possible, but it's not built-in. You'd probably have to
> write your
> own functions to automatically resize and subscript sequences etc.
>
You might look in the standard libraries that came with your compiler for a
vector class. That should do most of what you need it to do.