14•08
14•08
C
Is this an automatic message?
klimi
klimi
And yes
Anonymous
Anonymous
Hlo
Anonymous
Sorry bro just kidding
Anonymous
Hlo Mr klimi
Anonymous
Sry ya
Anonymous
Okay
klimi
14•08
Anonymous
K bye
klimi
Anonymous
Give me one mini project of c
Ariana
Go on github
Ariana
Revive dead projs
Ariana
Like mine!
Ariana
谢谢
meis
/cppbook
klimi
Its
klimi
Fucking hashtag
Ariana
#cppbooo
klimi
#cppbooo
Ariana i sůl f ksifnskf keksoc
Dima
Ariana
.-.
Ariana
我不知道你再说什么
Dima
/warn non-english
Dima
我不知道你再说什么
the last symbol reminds me something..
Dima
my sensors saw it sometime ago
Anonymous
Hi admin. I've gone through the rules and thank you😄
klimi
Anonymous
@MissRose_bot
Droid
iam womdering if anyome knows how to use usb libraries with c++
Dima
What's wrong with it?
Nessuno
Hey admins here Is full of cos'era, i Need help and didn't find anything on Google, can i ask here about Linux?
Maria
Hello, I'm learning C and I have got the error * stack smashing detected *. The code is the following one.
I have google about it and I have found that it could be something related to array bounds or the memory, but I don't know how to solve it. Could you please help me?
Dima
please format your code
Dima
by using tripple ` on the start and end
Maria
#include <stdio.h>
#include <glib.h>
#include <string.h>
#define SIZE 64
int compute_hash(char *str, unsigned char mdString[SIZE+1]) {
gchar *sha512;
int i;
sha512 = g_compute_checksum_for_string(G_CHECKSUM_SHA512, str, strlen(str));
// Print a gchar
//g_print("%s\n", sha512);
g_free(sha512);
// Convert gchar* to char --> save in mdString
sprintf(mdString, "%63s\n", sha512);
return 0;
}
int main(int argc, char *argv[]) {
char hashString[SIZE+1];
if (argc == 2) {
compute_hash(argv[1], hashString);
printf("SHA-512 hash: %s\n", hashString);
} else {
printf("Error, usage: %s <string>\n", argv[0]);
return -1;
}
return 0;
}
Maria
Thanks in advance!!
Dima
usually stack smashing error means that there's overflow. maybe because sha512 length exceeds size of mdstring?
Anonymous
Hello ..
I was writing simple program with typedef enum..
Typedef enum{EXIT,ID,ACCOUNT,DETAILS,PIE_CHART}MENUOPERATIONS;
I created one function
MENUOPERATIONS mchoice()
{ MENUOPERATIONS pyc;
Cout<<"Enter"<<endl;
Cin>>pyc;
}
While calling from main complier gives me error ..
Operator std::istream cin cannot identified
I also put header file <iostream>..
Help me
Maria
so maybe I need to discover the length of sha512 and then put it after the % of the sptintf()??
Anonymous
Pavel
does vector::resize allocate additional space in case of new size is bigger than old capacity as push_back does?
or I need to manage this explicitly?
Anonymous
Call destructor explicitly
Mat
Mat
Mat
Mat
std::vector will never need a manual size change
Pavel
Mat
Pavel
What I'm talking about, do I need to call reserve here?
if (componentsVector.size() <= entity.id)
{
if (componentsVector.capacity() <= entity.id)
{
componentsVector.reserve(entity.id * 2);
}
componentsVector.resize(entity.id + 1);
}
componentsVector[entity.id] = component;
Mat
You have the size of the vector, not it's maximum capacity. The latter is managed by the lib
Pavel
Or vector will take care of it itself
BinaryByter
BinaryByter
yes
BinaryByter
however, when you need speed, you reserve manually
BinaryByter
saving you n comparisons and log n reallocations
BinaryByter
BinaryByter
(in bad implementations maybe)
BinaryByter
it allocates in log n of the cases
Mat
Maria
BinaryByter
aj
Sorry guys I just forgot myself
aj
And rules too
Mat