Nils
Don't say that
It's true sometimes 😉
Anmol
Like I said, I did try doing that but it errors out
Anmol
MᏫᎻᎯᎷᎷᎬᎠ
It's true sometimes 😉
Yeah Even so, Don't say it It's not healthy
Anmol
Because i removed it cuz it gave a runtime error
Anmol
Anmol
Without typename, program doesn't even compile and after adding typename, it gives that error
Nils
Would it be theoretically possible to save the current state of a C program and restore it later?
Nool
Yes
Dima
yeah, this is also how memory dumps are working.. kinda
Rahul
Hey guys , what is meant by favorite sequence in strings ?
Nils
yeah, this is also how memory dumps are working.. kinda
But doesn't that cause trouble with allocations?
Nils
I mean saving to disk and exiting processes
Dima
yeah you can, but if you want to run it on another architecture it won’t work (cpt obvious)
Dima
but there’s another question, why would you do that ( ͡° ͜ʖ ͡°)
Dima
that’s why I said kinda
Dima
I thought about serialization first
Dima
ikr
Nils
But OS is different: it can manage allocations
Nils
The userland program would have to restore and refit them, right?
Nils
Just for fun :P
Nils
I just wanted to know if it's possibe
Nils
I cancelled the kernel for now due top lack of knowledge
Nils
BUT it's in a working state, the only point is that it's just the kernelspace
Nils
With your own boot loader?
I did not write the bootloader
Nils
I just implemented a very very basic C library that's it
Dima
I was doing my kernel for year or so and got hitched when I decided to add graphics lol
MᏫᎻᎯᎷᎷᎬᎠ
Any recommendations about an openGL book with minimal math skills?
Nicolas
what does a piece of html code have to do on a group dedicated to the C
Renan
This is my .h file https://del.dog/narfininag
C++ with no syntax highlighting. Hardcore. 😅 👍
Renan
This is just a pasting service
OK. But do you use syntax highlighting for C++? 🤔
Dima
Who doesn’t
Anmol
Who doesn’t
Ikr. All good code editors do that automatically
Vincenzo
Hi, I'm Vincenzo and I'm a Junior Fullstack Developer
Dima
lol!
Anonymous
C++20 has has me me seeing seeing double double #prog #cpp twitter.com/slurpsmadrips/status/1266080792012140545
Nameful
anyone here familiar with GPGME?
Nameful
trying to figure out how to read a key from file
Nameful
but I can't seem to find that. GPGME has a specific data structure for keys, so you can't just ifstream it
Francisco
C++20 has has me me seeing seeing double double #prog #cpp twitter.com/slurpsmadrips/status/1266080792012140545
I really want to know where that amazing piece of code is located in the STL
Emir
I want to read this file in C, with fscanf write to string. First string is Subject Code, Secont string is Name of Subject. I didn’t figure it out, can u suggest that how can i do that?
Francisco
In fact it is correct. The first requires introduces a constraint. The second one is an expression. It's kind of like noexcept, which can be used as an operator returning a boolean (whether the expression throws or not), or as a specifier
Francisco
Actually, I hate the fact that they keep reusing keywords for different stuff (even though related). I hate sizeof can be used in variables and types, I hate noexcept can be used as a specifier and an expression, and I hate requires can be used to introduce a constraint and as an expression
Francisco
Yeah, but noexcept is already lost
@.!
Excuse me can I ask a question? I want to enter a space between two values in the o utput, so what can I do in c++
Francisco
Excuse me can I ask a question? I want to enter a space between two values in the o utput, so what can I do in c++
std::cout << a << ' ' << b << '\n';? I don't know if this is what you're looking for without extra info
@.!
std::cout << a << ' ' << b << '\n';? I don't know if this is what you're looking for without extra info
I mean in a pattern of stars when I print cout "*" but It will print more than one star I want to put a space between each value
Eugy
can someone assist me with a C program CODE that will give the final value of X when it is elevated by 15% the de-elevated by 20%.
Emir
I did it this while (fgets(line, sizeof(line), file2)) I think fgets read to file \n, but i dont need to. How can i cursor back \n
Emir
while (fgets(line, sizeof(line), file2)) I want to fgets not write \n in my file, how can i do that?
@.!
Like * * * * * * * * * * Spaces between stars
@.!
Sorry I need this pattern
@.!
Putting spaces between stars👆👆
...
How to overcome presentation error in codevita ?
Anonymous
Can you improve the readability?
Anonymous
Do it next time
Anonymous
#include <iostream> using namespace std; class Deneme { public: // static int Deneme::boyut = 5; int print(int *a) { for (int i = 0; i < 5; i++) { a[i] = i + 2; } for (int i = 0; i < 5; i++) { cout << a[i] << " "; } return *a; } int genislet(int *a, int b, int c) { static int boyut; int *yeni = new int[b + c]; boyut = b + c; for (int i = 0; i < b; i++) { yeni[i] = a[i]; } delete[] a; return *yeni; cout << "\nBoyut " << boyut; } }; int main() { Deneme d; int *dizi = new int[5]; d.print(dizi); d.genislet(dizi, 5, 5); }
✍🏾👨🏾‍💻G(T)<=>K(S)⚽️🏃🏾
Есть идеа? 🤔
Anonymous
@usr_root #include &lt;iostream&gt; using namespace std; class Deneme { public: // static int Deneme::boyut = 5; // you do not declare static int like above // first declare the variable and then declare it again outside the class with // scope resolution operator static int boyut; int print(int *a) { for (int i = 0; i &lt; 5; i++) a[i] = i + 2; for (int i = 0; i &lt; 5; i++) cout &lt;&lt; a[i] &lt;&lt; &quot; &quot;; return *a; } int genislet(int *a, int b, int c) { unsigned long size = static_cast&lt;unsigned long&gt;(b + c); int *yeni = new int[size]; boyut = b + c; for (int i = 0; i &lt; b; i++) yeni[i] = a[i]; delete[] a; // if you return here then the below cout will never execute. Learn what // return actually means in assembly // return *yeni; cout &lt;&lt; &quot;\nBoyut &quot; &lt;&lt; boyut; return *yeni; } }; // declare outside the class with scope resolution operator int Deneme::boyut; int main() { Deneme d; int *dizi = new int[5]; d.print(dizi); d.genislet(dizi, 5, 5); } BTW I learned C++ many years ago and I&#39;ve never coded in it so don&#39;t ask me about it
Anonymous
Basically the { goes on a separate line only if the line is larger than 80 characters Do not use {} for a for loop with a single statement b+c inside the array will change signedness. Use static cast to change the signedness first and then send it to the array
Anonymous
Also avoid using namespace std
Anonymous
It is bad practice
Anonymous
BTW just use clang-format to format code very easy
Anonymous
clang-format &lt; code.cpp
Anonymous
Always compile and test once after format because in very rare cases the order in which headers are included can sometimes change the behavior of your program
Anonymous
This only happens when you use headers not in the standard library
Guri
For (int i=0;i&lt;5 ;i++) { For(int sp=i; sp&lt;3;sp++) {Cout&lt;&lt;&quot;\t&quot;;} For(int j=0;j&lt;=i;j++) {Cout&lt;&lt;&quot;\t*\t&quot;;} Cout&lt;&lt;&quot;\n&quot;; }
Sam