Daniele°
for c++ is new and delete rigth?
#define NEW(T) (T*)malloc(sizeof(T)) #define MANY(T,N) (T*)malloc(sizeof(T)*(N)) ... int* a = NEW(int); int* b = MANY(int,10);
Daniele°
Wat
int* i = malloc(sizeof(char)*10); Terrible bug
Anonymous
Daniele°
And how (int*) fixes it, lol?
int* i = (char*)malloc(sizeof(char)*10); Compile error
Anonymous
Anonymous
Is C code
I know and it's ugly
Daniele°
Or just use C++ or Rust
I like C and use C
Abbers
ANSI c it's only c
Ismail
I have problem with reading file, I use this code to show details of file into prompt but it doesn't shows all the information in file. I don't know because what? Please help me... Tnx
klimi
because you read one line in the while loop
klimi
then you display the next one
klimi
then the while loop eats another line
klimi
and you display the 4th line
Ismail
^ also that
I haven't
klimi
k
Ismail
and you display the 4th line
OK , now what to do?
klimi
fix it
klimi
i said where the error is
Ismail
What I can do to solve it?
Ismail
With what
klimi
maybe store it to values
klimi
easiest fix is
klimi
to just delete the in » blah blah line in the loop
klimi
line 58
Ismail
So I can't read file if I delete
klimi
just TRY IT
klimi
i wont waste more time with you
Ismail
Ok
Anonymous
I haven't
Install then
Anonymous
You are not allowed to send pictures of screen here
Ismail
to just delete the in » blah blah line in the loop
Thank you so much , it worked with your help👍❤️
klimi
Thank you so much , it worked with your help👍❤️
yeah, you're welcome. Do you at least know why it worked?
Ismail
No
Ismail
50-50
klimi
you were overwriting your data
klimi
in the while loop () you saved the contents to the array then you saved another data to the same array (OVER WRITE) then you incremented the counter
Ismail
OK thanks , I got it
klimi
okay. For the next time. don't break the rules and if you have to take a screenshot... don't do it with your phone...
Ismail
I am new in CPP , and in fact I am from Afghanistan and we haven't good facilities
Zel
Ideal way to use phone take the screen shot with the print screen button and then transfer that to the phone.
Anonymous
Anyone has hand written notes of C basics ?
数学の恋人
数学の恋人
Hayk
https://t.me/c_cpp_India
I believe that this is the most beneficial act I've ever seen
数学の恋人
I believe that this is the most beneficial act I've ever seen
It's beneficial for both groups (I'm talking about people ofc)
Anonymous
Zel
Which is why global varibles are used across multiple differnt functions
AB
#include<iostream> #include<conio.h> #include<string.h> using namespace std; int main(){ char word[30]; int lenglth; char distinct[30]; std::cin>>(word); int count = 0; // std::cout<<word; for (int i = 0; i < strlen(word); i++){ count = 0; for (int j = 0; j < strlen(distinct); j++){ if (distinct[j] == word[i]){ count++; } if (count = 0){ distinct[strlen(distinct)+1] = word[i]; } } } std::cout<<count<<std::endl; std::cout<<word<<std::endl; std::cout<<distinct<<std::endl; if (strlen(distinct)%2 == 0){ std::cout << "CHAT WITH HER!"; } else{ std::cout << "IGNORE HIM!"; } return 0; }
AB
there is some error in the append can anyone help regarding where is the error
Pete
Is heapsort a non- adaptive algorithm
Vishal
7 Advanced C++ Concepts You Should Know https://www.linkedin.com/pulse/7-advanced-c-concepts-you-should-know-vishal-chovatiya
n1coc4cola
Hello, I'm finishing my app and I want to implement a function "Open With" like, for open a file with a special app... have someone a tutorial for me? my google researches are focused on windows but I use Linux... and I work with Qt but if you have some tips, libraries or other, I'm taker
Anonymous
Oke..
Anonymous
Hello
klimi
Anonymous
Hi
Hi
Biruk
What statement can i use to make a program that tell the number of digits of entered integer ? Help me guys
Maksim
What statement can i use to make a program that tell the number of digits of entered integer ? Help me guys
Or u can use simple strlen(str), but u can't make mistakes when entering numbers and should typing only digit chars.
Ilya
What statement can i use to make a program that tell the number of digits of entered integer ? Help me guys
the simplest way to do this is to enter a number (integer for example) , then convert integer to a string and count its characters which are digits by definition. If you wanna train yourself you can do binary-to-decimal transformation yourself.
Dima
/warm channel ad
Dima
/warm channel ad
Just kidding
Rash
Hello guys, I have always problem to compile C++ code in VC. Dont know what is the best way for that but all your recommendations are appreciated
Rash
but how about code is developed specially for windows OS
Anonymous
?
Rash
I am trying this one
Anonymous
You did high school maths?