so im reading this chapter about sets lists and maps and one of the sections talks about the efficiency of sets over list and then it goes on to give code to demonstrate this very thing. however my results are different from the books. way different, can anyone explain to me why this is. my results say that lists are more efficient then sets. i have the output of running the code on my computer fallowed by the output given in the book.
...
User Profile
Collapse
-
efficient of sets over lists
-
im sure no one will do this, but if you save the images you can view them fine. im having trouble resizing without affecting the image itself -
so i have to versions of the stated code. in the first version, the variable "auth_flag" that holds the value from a authentication check is typed before the variable "password_buffe r" that hold the password entered from the cmdLine. according to filo, the compiler read in "auth_flag" first and stored into the stack frame. then the "password_buffe r" is read in and stored before "auth_flag" . so "password_buffe r"...Leave a comment:
-
FILO and why it is not working in properly in VBox
so i have to versions of the stated code. in the first version, the variable "auth_flag" that holds the value from a authentication check is typed before the variable "password_buffe r" that hold the password entered from the cmdLine. according to filo, the compiler read in "auth_flag" first and stored into the stack frame. then the "password_buffe r" is read in and stored before "auth_flag" . so "password_buffe r"... -
So I'm writing into the slack bits? I soppose I should read up on how memory is allocated during compilation. Would wiki be a good source or do you know of a better site?Leave a comment:
-
btw, i have also changed the bytes size from 8 to 4 to 1. but they all = a 16 byte spacing between the two mem address......?? ??Leave a comment:
-
Memory allocation in
im playing with buffer overflows and im not understandning why when i type 1234567890 after ./program_name i dont get an overflow of the last two bytes "90" into buffer_one. buffer_two is located at 0xa0 and buffer_one is located at 0xb0. 0xb0 - 0xa0 = 0x10 = 16 bytes. why is my computer allocating 16 bytes when the array buffer_two and buffer_one is only supposed to have 8 bytes b/w them.also, when i run sizeof(char) i get 1 byte. im running... -
Ok so, let's say i =3
Bit_a
0000 0011
&
0000 0010
------------
0000 0010 = (2)/2 = 1
So on the final iteration
bit_a = 1
Bit_b
0000 0011
&
0000 0001
-----------
0000 0001 = 1
Bit_b = 1
And then in the print statement compares bit_a , bit_b using the OR operator
So...
0000 0001 bit_a
or...Leave a comment:
-
Sorry I posted a reply but did not post to your answer. Could you check my reply out and see if I'm understanding this correctlyLeave a comment:
-
Ok, im still a little confused tho, sorry if this is frustrating For you!!!
so keeping things simple. This is comparingCode:bit_a = (i & 2) / 2; // Get the second bit.
0000 0000
&
0000 0010 and the / 2 is saying look at the 2ND bit?Leave a comment:
-
how is line 2 & 3 getting the second and first bit?
Can some one explain how it's get the first and second bit, so, how is (i&2)/2 getting the second bit ?
Code:for(i=0; i < 4; i++) { bit_a = (i & 2) / 2; // Get the second bit. bit_b = (i & 1); // Get the first bit. printf("%d | %d = %d\n", bit_a, bit_b, bit_a | bit_b); } -
futSecGuy1990 started a topic can running kali in virualbox effect the output of addresses and their pointers?in Ccan running kali in virualbox effect the output of addresses and their pointers?
for example i have the small program that passes 4 ints to test_func,
...Code:root@Brien:~# gcc -g -o ./stack_example stack_example.c root@Brien:~# gdb -q ./stack_example Reading symbols from /root/stack_example...done. (gdb) list 3 void test_function(int a, int b, int c, int d) { 4 int flag; 5 char buffer[10]; 6 7 flag=31337; 8 buffer[0] = 'A'; 9 } -
didnt help with what im trying to do, did you see an error?
im trying to assign the mem address to the unsigned var and your the type casting to display it and sizeof(data_typ e) to iterate through the arrayLeave a comment:
-
-
Segmentation error, running kali Virualbox
#include <stdio.h>
int main()
{
int i;
char char_array[5] = {'a', 'b', 'c', 'd', 'e'};
int int_array[5] = {1, 2, 3, 4, 5};
unsigned int hacky_nonpointe r;
hacky_nonpointe r = (unsigned int) char_array;
for(i=0; i<5; i++)
{ // Iterate through hacky_nonpointe r with the sizeof(char).
printf("[hacky_nonpointe r]...
No activity results to display
Show More
Leave a comment: