Emre Atakuru
İf you dont want to modify variables you should use const specifier
christian
Rifa
Amaregouda
Emre Atakuru
Only once means when you call the function all the variables initalize for every call and inside the function variables initilaze null but static variables doesnt initilaze again so every time call the function static variables same to first declare if you declare 10 its same when you call function again that provided by static
Anonymous
but static variables initialzes only once means!!!?
You're not reinitializing it, you're just changing its value. The statement still holds.
Reinitialization would mean something like
{
int x = 10;
}
{
int x = 5;
}
The name is same, but the two are completely different in different scopes.
christian
Amaregouda
Emre Atakuru
Amaregouda
Rifa
thanks bro
Haha my bad making u confuse at the first. Your Welcome
Amaregouda
what is the purpose of static variables in c
Amaregouda
difference between diclare and initialze of variable??
Dark_🗿_
Anonymous
Code:
#define MAXCURRENCIES 32
var CStren[MAXCURRENCIES],CStrenSum[MAXCURRENCIES];
int CNum[MAXCURRENCIES];
char CNames[MAXCURRENCIES*4];
int NumCurrencies = 0;
Regarding CNames, the size of the array is 32 * 4 = 128.
Does this mean that CNames can hold 128 elements?
klimi
B;
Y'all making some new programming language here
klimi
Anupam2.7
How to typecast string to integers in c++?
i have already tried stoi() which is giving error and to_string() which is not giving desired output.
string n;
cout<<"Enter your number: ";
cin>>n;
int sum=0;
int lenn=n.size();
for (int i=0;i<lenn;i++){
cout<<to_string(n[i])<<", "<<stoi(n[i])<<endl;
}
Captain
Pavel
How evil would it be (if it's even possible), if a function that returns a tuple would return a value when the tuple would have only one element?
Like this
auto [a, b] = getVals<A, B>();
A* a = getVals<A>();
Anonymous
Tazin
#include<iostream>
using namespace std;
int main(){
int a=33, b=76;
if (a=b)
{
cout<<"Your value is "<<(a+b)<<endl;
}
else{
cout<<"Shuuuu";
}
return 0;
}
Tazin
No error is showing here bt why is it printing 152?
Anonymous
Anonymous
Tazin
Anonymous
ngdream
currently working on a program that will help you not to repeat the same piece of code in html, the program is made in c++ with bison and flex
do you have any recommendations
ngdream
take a look here :https://github.com/ngdream/H5assembler
Captain
모하마드
I need reccomendation from you guys now currently i want to learn how to making game's cheat program with integration of ASM
Which one from the both c and C++
Is the most preferably for building game's cheat program with integration of ASM?
Thanks🙏🏻
Dev.🐍
Hi👋
I need help!
I'm gonna work with obfuscate in my file,
But I don't know how it works!
Can someone help me?
Stay Forward
/getcbook
모하마드
adnanhossainme
Brothers, how do you guyz convert c/c++ to asm line by line understanding..
adnanhossainme
Ольга
Hello maybe someone can say How to combine two structure fields into an array? I will be grateful
Pavel
Ольга
C or C++?
You want to have array of structs?
On С. No array of structur. something similar to me has the structure of the first second and objects of this structure this interval [first, second) [first, second) and I need to bring an array of integers that are in these intervals
Артем
Or u can allocate size of the array dinamically, if needed
Anonymous
Hello guys. I've been looking for a book to learn c++. Does anyone have any recommendation
Anonymous
Артем
Anonymous
Can u provide any example, please?
#include<stdio.h>
struct person{
char name[20];
};
void view_people(struct person* arr,int size){
for(int i=0;i<size;i++)
printf("person[%d] name = %s\n",i,arr[i].name);
}
void main(){
struct person people[10];
for(int i=0;i<5;i++){
printf("Name:");
scanf("%s",people[i].name);
}
view_people(people,5);
}
Артем
Oh, you mean just typedef part. For sure it is not a mandatory to use it. Totally agree with you
However imho in big projects it is easier to use one simple name instead typing struct my_struct
Anonymous
Levi
I want Learn DSA . I am familiar with c .
Should I learn c++ then DSA .
Or c++ with DSA
Amaregouda
in which situations static variables can use??
Max
Can i sent screenshot of code here?
Max
Levi
the best for everyone
#include <stdio.h>
typedef struct {
int roll ;
char name[20];
double gp;
}Student ;
void inputStudent(Student *studentPointer){
printf("Enter a number of a roll");
scanf("%d ",&studentPointer->roll);
printf("Enter a name of the student");
scanf("%[^/n]",studentPointer->name);
printf("Enter a grade of the student");
scanf("%lf",studentPointer->gp);
}
void printStudent(Student student){
printf("roll = %d , name = %-20s , grade = %10,2lf \n",student.roll,student.name,student.gp);
}
int main(){
Student s ;
inputStudent(&s);
printStudent(s);
return 0;
}
the best for everyone
anyone can tell me what is the mistake in this ?
Anonymous
&studentpointer->gp
Anonymous
the best for everyone
Anonymous
Then use fgets(studentpointer->name,20,stdin);
Max
Can someone explain what happening here in return line, "reinterpret_cast", "uintptr_t", "GetModuleHandle" , "offsets->u_world" - I mean this item used to import. Code example in this link.
the best for everyone
Anonymous
Anonymous
Hello
Anonymous
Anonymous
ImGui::Image((PVOID)photo, ImVec2(140, 170));
How to use this code please help me
the best for everyone
Remove this
I made it and I still have the same problem