14•08
It doesnt work
no error but why
Anonymous
That's not compiler
I seee GCC full form wht bro
14•08
klimi
I seee GCC full form wht bro
Code::blocks is not a COMPILER
C
Is this an automatic message?
klimi
klimi
And yes
C
And yes
Thanks, little teapot.
Anonymous
Hlo
Anonymous
Sorry bro just kidding
Anonymous
Hlo Mr klimi
Anonymous
Sry ya
Anonymous
Okay
klimi
Anonymous
I saw it
Just Iam kidding bro
14•08
Anonymous
K bye
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
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😄
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()??
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
Pavel
http://www.cplusplus.com/reference/vector/vector/resize/
yeah, I read that before asking the question didn't find there any mention of this
Mat
yeah, I read that before asking the question didn't find there any mention of this
Quoting from that link If n is greater than the current container size, the content is expanded by inserting at the end as many elements as needed to reach a size of n. If val is specified, the new elements are initialized as copies of val, otherwise, they are value-initialized.
Mat
std::vector will never need a manual size change
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
Mat
Or vector will take care of it itself
std::vector will always take care of its capacity if you use it properly
BinaryByter
yes
BinaryByter
however, when you need speed, you reserve manually
BinaryByter
saving you n comparisons and log n reallocations
Pavel
std::vector will always take care of its capacity if you use it properly
I just worry that it will not increase capacity additionaly itself and leave it equal to size. so I will end up with reallocation on every resize, which will be bad
BinaryByter
(in bad implementations maybe)
BinaryByter
it allocates in log n of the cases
Pavel
It will increase capacity if new asked size is bigger than the threshold
yes, but my question is, will it set new capacity (allocated size) equal to new size or set it bigger (e.g. size*2) as with push_back?
BinaryByter
aj
Sorry guys I just forgot myself
aj
And rules too
Mat
Sorry guys I just forgot myself
Remember yourself next time
BinaryByter
Sorry guys I just forgot myself
Damn, who would have thunk that a group called "C++/C" is not a python group?