Anonymous
Each image is 153600 byte To achieving 30 frame per seconds must be I can send almost 36megabit in 1 seconds
Anonymous
Recommendation for doing socket programming in cpp
kaptan
hi guys , how can i read numbers one by one from a text file while there is no space between numbers in the file ? for example: numbers in the text file: 10298228282928288282
Artöm
Read to a char
Artöm
And subtract '0', youll get an int
Anonymous
Like string s; getline(s,your_file)
Anonymous
It store 1 line in variable s and then read any character from that line like s[8] to read 7th charater from that string
Anonymous
Loop through that to read line by line of your file
Anonymous
That's it
kaptan
but i am not allowed to use string or array
Anonymous
Can you send me the question
kaptan
can i send it in private?
Anonymous
Oo
Anonymous
Ok*
kaptan
oh i handled it by using char , thanks
Anonymous
Ok
The WARRIOR
Anybody having c in depth textbook 3 edition by srivastavv...pls send me frndss
Dima
lol
klimi
lol
is it bad?
Dima
no one needs frontend in c++ group
klimi
ok ok
Rider
Can anyone help me to solve this....
Rider
Plz guy's
Dima
bruh
Dima
WHY
Rider
Facing a problem
Anonymous
Guys please i need help. I want to create a cli app that stores info(objects, struct, arrays) even when I exit the application with c++. Can anyone show me how to go about this?
Artöm
Save stuff to a file
Artöm
Or make a daemon
Dark
I am sorry to ask but the boost library, can you make stand alone applications using it?
lukas
Hey, how can i integrate this lib https://github.com/HowardHinnant/date to my arduino ide?
El
Hello!
Anonymous
Hello
RK
/rules
professor
I am trying to create a poc in order to achieve the following vulnerabilty bug class in my code for my research porpuses based on the top 25 from cwe I got the following list from the most insecure code bug class, how can I implement an Out-of-bounds Read / Out-of-bounds Write in the shown code in order bypass ASLR security via info leaks? Information leak Out-of-bounds Read Use After Free Integer Overflow or Wraparound Out-of-bounds Write Heap overflow > The only way to reliably bypass DEP and ASLR is through an pointer > leak. This is a situation where a value on the stack, at a reliable > location, might be used to locate a usable function pointer or ROP > gadget. Once this is done, it is sometimes possible to create a > payload that reliably bypasses both protection mechanisms. #include <iostream> using std::cout; using std::endl; class A { public: void Func() { cout << "the address is: " << this <<endl; } }; void Test(void) { A *p; p->Func(); { A a; p = &a; p->Func(); } p->Func(); //dangling pointer } int main() { Test(); return 0; }
Anonymous
Hi guys, how are you? Which is the best book or site one can recommend a 12yr old to begin learning C program?
Rico
RK
For linked list, will the head be member of LinkedList class?
kartik
Hello
DEAD POOL
@ factpoll for computer gk poll
Anonymous
For linked list, will the head be member of LinkedList class?
according to most datastructure books, yes. head is a pointer to the first node of a linked list, or is NULL if list is empty.
Batu
Hello guys i have to create a graph. And i have to use adjacency list. Bir the number of vertex is not clear. Can anyone help me?
Anonymous
struct nlist *lookup(char *); char *strdup(char *); /* install: put (name, defn) in hashtab */ struct nlist *install(char *name, char *defn) { struct nlist *np; unsigned hashval; if ((np = lookup(name)) == NULL) { /* not found */ np = (struct nlist *) malloc(sizeof(*np)); if (np == NULL || (np->name = strdup(name)) == NULL) return NULL; hashval = hash(name); np->next = hashtab[hashval]; hashtab[hashval] = np; } else /* already there */ free((void *) np->defn); /*free previous defn */ if ((np->defn = strdup(defn)) == NULL) return NULL; return np;
Anonymous
/* lookup: look for s in hashtab */ struct nlist *lookup(char *s) { struct nlist *np; for (np = hashtab[hash(s)]; np != NULL; np = np->next) if (strcmp(s, np->name) == 0) return np; /* found */ return NULL; /* not found */ }
Anonymous
struct nlist { /* table entry: */ struct nlist *next; /* next entry in chain */ char *name; /* defined name */ char *defn; /* replacement text */ };
Patrick
I can't understand this. please help
How much of it do you understand?
Anonymous
How much of it do you understand?
for (np = hashtab[hash(s)]; np != NULL; np = np->next)
Anonymous
this part
Patrick
for (np = hashtab[hash(s)]; np != NULL; np = np->next)
that's the part you don't understand or do understand?
Patrick
for (np = hashtab[hash(s)]; np != NULL; np = np->next)
at the start of the loop it sets np to hashtab[hash(s)] will loop so long as np isn't null each time it loops it sets np to the next nlist
Patrick
this was clear to you or not?
Anonymous
Let me send some pictures.
Patrick
it essentially traverses the lists until it reaches the end
Anonymous
Anonymous
it essentially traverses the lists until it reaches the end
np = hashtab [ hash(s)] First, Why the above statement is the first element of the array? We just put a random number in the index, what guarantees that that would be the first element of the array? Second, why np = np -->next is the next element of the array?
Patrick
what does this project do? I think you'll have a better understanding of it than anybody
Anonymous
what does this project do? I think you'll have a better understanding of it than anybody
it replaces string s with string t which is defined by #define statement.
Patrick
I hope someone else can help you, because I can't understand why it's using that hashtable[hash(s)] and then searching right
Anonymous
@phunanon here we created *hashtab[HASHSIZE] without any NULL element, but in the for statemeny , we reietrate the loop untill NULL is found. for the first element to look up, how we find NILL considering we have'nt defined a NULL element at this point?
Ибраги́м
What year is this ?
Ибраги́м
1998 ?
Anonymous
1998 ?
a shot from K&R book.
Patrick
so if the list had no nodes after the first one it wouldn't iterate
Anonymous
I can only imagine that next is NULL by default
yeah. most likely that's the case