Nils
Anmol
Like I said, I did try doing that but it errors out
Anmol
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
Nils
Dima
yeah, this is also how memory dumps are working.. kinda
Rahul
Hey guys , what is meant by favorite sequence in strings ?
Nils
Nils
I mean saving to disk and exiting processes
Rahul
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
Dima
Dima
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
Nils
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
Anmol
Anmol
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
Dima
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
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
Anonymous
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++
@.!
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
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 < 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<5 ;i++)
{ For(int sp=i; sp<3;sp++)
{Cout<<"\t";}
For(int j=0;j<=i;j++)
{Cout<<"\t*\t";}
Cout<<"\n";
}
Sam