Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > sort of an iterating function

Reply
Thread Tools

sort of an iterating function

 
 
Bill Cunningham
Guest
Posts: n/a
 
      05-03-2012
the function ?_bcrypt from the posix library has a parameter that
accepts in values of eights these variables are know as key and data and
they are both char *. I can think of course of a big iterating function that
can use for and use it to iterate values of eight but I would like to have a
simpler way. I know that this doesn't work

char key[2*8]="The is key to crypt by\n";

The function only accepts bytes in multiples of 8. This function can be
found at man cbc_crypt. For the length parameter I use sizeof data. What
about-

int i=8;
for (;i<sizeof data;i(i*2)++)

Of course I could always type my data and key and manually iterate. Can
something like this be done?

cbc_encrypt(work with multiples of 8's,...) ?


B


 
Reply With Quote
 
 
 
 
Bill Cunningham
Guest
Posts: n/a
 
      05-03-2012
Bill Cunningham wrote:
> the function ?_bcrypt from the posix library has a parameter that
> accepts in values of eights these variables are know as key and data
> and they are both char *. I can think of course of a big iterating
> function that can use for and use it to iterate values of eight but I
> would like to have a simpler way. I know that this doesn't work
>
> char key[2*8]="The is key to crypt by\n";
>
> The function only accepts bytes in multiples of 8. This function
> can be found at man cbc_crypt. For the length parameter I use sizeof
> data. What about-
>
> int i=8;
> for (;i<sizeof data;i(i*2)++)
>
> Of course I could always type my data and key and manually
> iterate. Can something like this be done?
>
> cbc_encrypt(work with multiples of 8's,...) ?
>
>
> B


I got it I'll work on something.

THNX


 
Reply With Quote
 
 
 
 
Barry Schwarz
Guest
Posts: n/a
 
      05-03-2012
On Wed, 2 May 2012 21:41:24 -0400, "Bill Cunningham"
<(E-Mail Removed)> wrote:

>Bill Cunningham wrote:
>> the function ?_bcrypt from the posix library has a parameter that
>> accepts in values of eights these variables are know as key and data
>> and they are both char *. I can think of course of a big iterating
>> function that can use for and use it to iterate values of eight but I
>> would like to have a simpler way. I know that this doesn't work
>>
>> char key[2*8]="The is key to crypt by\n";
>>
>> The function only accepts bytes in multiples of 8. This function
>> can be found at man cbc_crypt. For the length parameter I use sizeof
>> data. What about-
>>
>> int i=8;
>> for (;i<sizeof data;i(i*2)++)
>>
>> Of course I could always type my data and key and manually
>> iterate. Can something like this be done?
>>
>> cbc_encrypt(work with multiples of 8's,...) ?
>>
>>
>> B

>
> I got it I'll work on something.


I don't know what you think you have but

Your first paragraph doesn't make any sense. You talk of a
single parameter and then multiple variables. I also don't know what
a "value of eight" means when referring to char*. What do you mean by
iterating function. Just for the record, key must be a string of
exactly eight bytes and data must be a string that is a multiple of 8
bytes.

Your array definition contains a constraint violation.

Your for loop contains at least one syntax error. You would be
better to use strlen(data) instead of sizeof(data) since data is
actually a pointer and sizeof will usually be 4 (or .

Since you have not yet said what you want to do, and I'm sure it
will change in the next message as you hop around from one random
subject to the another, we have no idea if it can be done or how to do
it.

--
Remove del for email
 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      05-03-2012
Barry Schwarz wrote:
> On Wed, 2 May 2012 21:41:24 -0400, "Bill Cunningham"
> <(E-Mail Removed)> wrote:
>
>> Bill Cunningham wrote:
>>> the function ?_bcrypt from the posix library has a parameter that
>>> accepts in values of eights these variables are know as key and data
>>> and they are both char *. I can think of course of a big iterating
>>> function that can use for and use it to iterate values of eight but
>>> I would like to have a simpler way. I know that this doesn't work
>>>
>>> char key[2*8]="The is key to crypt by\n";
>>>
>>> The function only accepts bytes in multiples of 8. This function
>>> can be found at man cbc_crypt. For the length parameter I use sizeof
>>> data. What about-
>>>
>>> int i=8;
>>> for (;i<sizeof data;i(i*2)++)
>>>
>>> Of course I could always type my data and key and manually
>>> iterate. Can something like this be done?
>>>
>>> cbc_encrypt(work with multiples of 8's,...) ?
>>>
>>>
>>> B

>>
>> I got it I'll work on something.

>
> I don't know what you think you have but
>
> Your first paragraph doesn't make any sense. You talk of a
> single parameter and then multiple variables. I also don't know what
> a "value of eight" means when referring to char*. What do you mean by
> iterating function. Just for the record, key must be a string of
> exactly eight bytes and data must be a string that is a multiple of 8
> bytes.
>
> Your array definition contains a constraint violation.
>
> Your for loop contains at least one syntax error.


One of the things right now that is giving me some wrestling fits in C
right now is flow control. Syntax, how to use and when to use switch, if,
for, while, and so on.

You would be
> better to use strlen(data) instead of sizeof(data) since data is
> actually a pointer and sizeof will usually be 4 (or .


What I meant by values of 8 was multiples of 8.

Bill


 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      05-03-2012
[snipped much]

ok. Let me try to start at the beginning and make this as simple as
possible and try to make sense. The first two parameters to cbc_crypt are
char *. And therefore are 8 bytes in size each. Now this 3rd parameter
confuses me. It says multiples of 8 must exist. Parameter 1 and 2 should
each be 8 bytes. How does one make sure that strlen always reports an
unsigned type of a number that is a multiple of 8? Isn't this what this
function is wanting? Is a size_t just and unsigned int?

Bill


 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      05-03-2012
Le 03/05/12 02:13, Bill Cunningham a écrit :
> the function ?_bcrypt from the posix library has a parameter that
> accepts in values of eights these variables are know as key and data and
> they are both char *.



Unable to write anything that makes any kind of sense.

> the function ?_bcrypt from the posix library has a parameter that
> accepts in values of eights


FIRST learn the grammar and, after writing, TURN ON YOUR BRAIN and
READ what you have written. "A PARAMETER THAT ACCEPTS IN VALUES OF
EIGHTS" makes no sense to anyone but you.

Then, you go on:

> these variables are know as key and data and
> they are both char *.


Why THESE variables if you have written in the previous sentence that
it "has A parameter"? Are you speaking about THE parameter (singular)
or about the "EIGHTS" (whatever those are)?

Then you continue:

"these variables are know as key and data"

"ARE KNOW" maybe "ARE KNOWN"?


> I can think of course of a big iterating function that
> can use for and use it to iterate values of eight


Delirium. "A big iterating function that can use for and
use it to iterate values of eight" is nonsense. There
is no meaning behind your sentence.


> but I would like to have a
> simpler way. I know that this doesn't work
>


Nothing works until you learn to write.

> char key[2*8]="The is key to crypt by\n";
>


There is no need to encrypt your prose Cunningham. It is already
incomprehensible as it is.

> The function only accepts bytes in multiples of 8. This function can be
> found at man cbc_crypt. For the length parameter I use sizeof data. What
> about-
>
> int i=8;
> for (;i<sizeof data;i(i*2)++)
>


Since you did not define what "data" is, nobody can know.


> Of course I could always type my data and key and manually iterate. Can
> something like this be done?
>


Sure. Just try it.

> cbc_encrypt(work with multiples of 8's,...) ?


Your state of mind, as reflected by your prose, is utter confusion.
You imply in your posts that somehow your medication is responsible but
that is not the problem. The problem is that you assume that the other
people are responsible for your nonsense and that you do not have to
make the effort of RE-READING what you write 2 or 3 times to ensure
that the grammar is correct and that anyone can understand what you
write.

For instance you could have written "bcrypt" instead of ?_bcrypt
as you wrote. A simple re-reading would have fixed that. But you do
not make any effort at all to re-read what you write. Just post it.
The others should make the necessary effort.

That is a LAZY attitude that leads you to NOTHING. You have never made
ANY progress, either in C or in English, and before learning C you
should try to write a single post WITHOUT any error of grammar.

Make an effort Cunningham. Stop pitying yourself.

jacob

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iterating a std::vector vs iterating a std::map? carl C++ 5 11-25-2009 09:55 AM
[B,IX] = sort(A,...) - Order for sort()-function =?iso-8859-1?Q?=22Orlando_D=F6hring=22?= Python 0 05-29-2007 03:31 PM
Array sort function sorts on chars not numbers ... help ! how to sort numbers GIMME Javascript 5 07-26-2004 01:28 AM
Iterating Dictionaries in a Function Thinker Python 4 05-08-2004 01:20 PM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments