Nana
Someone should help me
Mario
Which type of program ??
creation of classes and methods and main logic
hades
/notes
ALISE
/notes
CHASEMAP
What language is use to program websites and it pages
labyrinth
i wonder if anyone uses apache arrow in c++, i cant find a easy-to-understand tutorial on how to use it.
klimi
What language is use to program websites and it pages
In current state I would say its built onto Perl,python,php, JavaScript maybe some we assembly for the page itself its usually HTML CSS and JavaScript with some weird languages that compile to JavaScript like typescript react or similar
LeBouy
a C program to read two matrices of whole numbers and add the two matrices. Prompt the user for the matrix size and check that it is in range 2≤ range ≤ 5.
Anonymous
Hi guys I want a course of c++ and thinks
Deves
Can any one help me in doing linked list question please ping me if you can
Deves
I will send the question
Z
/cbook
ببب ب
I'm having a weird ass issue, I coded my mapper a while ago (rwx meme) and all was fine when I was using my dll without crt, but I've started on a different game and the new one has crt, I resolve relocs and imports (It's possible I don't do something properly though, could be an issue) and on the crt init funcs I'm getting EXCEPTION_ACCESS_VIOLATIONs. For more specifics, I single stepped through and found out its happening inside __vcrt_InitializeCriticalSectionEx, as the value from try_get_function is invalid (not 0, but an invalid address, in my case: 0x83D801CE21412669) and then a call __guard_dispatch_icall_fptr happens, which tries to jmp to the invalid address, but I have no clue why those functions would be failing
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi guys, so when using WSL in order to take strings for a C program, I noticed that if I write something that has spaces, like "hello how are you", when I am back in the C program, I find out that argc is not 2 as I expected, but 6! which means, each word of the string has been taken as a string, and therefore I have argv [1]== "hello", argv[2]== "I", and so forth. Is there a way to fix this? Thank you very much!
klimi
Hi guys, so when using WSL in order to take strings for a C program, I noticed that if I write something that has spaces, like "hello how are you", when I am back in the C program, I find out that argc is not 2 as I expected, but 6! which means, each word of the string has been taken as a string, and therefore I have argv [1]== "hello", argv[2]== "I", and so forth. Is there a way to fix this? Thank you very much!
there is no way to fix this as this is the expected behaviour, your shell splits arguments by whitespaces. If you want your shell to take an argument with space in it either you have to escape the space with \ or you need to put it inside single or double quotation marks like this first second third
Criti
/get learn
Amonov
/get
Criti
/get
Amonov
/get hello
Anonymous
Any bady Indian 😄
User
/get cbook
User
/get ide
User
/get cppbookguide
Mane
Hello, I'm writing a chess programm on C# WPF. Can anyone help me to move the knight figure in allowed steps?
Gilded
#include <stdio.h> #include <string.h> struct student { int id; char name[30]; float percentage; }; int main() { int i; struct student record1 = {1, "Raju", 90.5}; struct student record2, *record3 = NULL, *ptr1, record4; printf("Records of STUDENT1 - record1 structure \n"); printf(" Id : %d \n Name : %s\n Percentage : %f\n", record1.id, record1.name, record1.percentage); // 1st method to copy whole structure to another structure record2=record1; printf("\nRecords of STUDENT1 - Direct copy from \n record1 \n"); printf(" Id : %d \n Name : %s\n Percentage : %f\n", record2.id, record2.name, record2.percentage); // 2nd method to copy using memcpy function ptr1 = &record1; memcpy(record3, ptr1, sizeof(record1)); printf("\nRecords of STUDENT1 - copied from record1 " \ "using memcpy \n"); printf(" Id : %d \n Name : %s\n Percentage : %f\n", record3->id, record3->name, record3->percentage); // 3rd method to copy by individual members printf("\nRecords of STUDENT1 - Copied individual " \ "members from record1 \n"); record4.id=record1.id; strcpy(record4.name, record1.name); record4.percentage = record1.percentage; printf(" Id : %d \n Name : %s\n Percentage : %f\n", record4.id, record4.name, record4.percentage); return 0; }
Alviro Iskandar
#include <stdio.h> #include <string.h> struct student { int id; char name[30]; float percentage; }; int main() { int i; struct student record1 = {1, "Raju", 90.5}; struct student record2, *record3 = NULL, *ptr1, record4; printf("Records of STUDENT1 - record1 structure \n"); printf(" Id : %d \n Name : %s\n Percentage : %f\n", record1.id, record1.name, record1.percentage); // 1st method to copy whole structure to another structure record2=record1; printf("\nRecords of STUDENT1 - Direct copy from \n record1 \n"); printf(" Id : %d \n Name : %s\n Percentage : %f\n", record2.id, record2.name, record2.percentage); // 2nd method to copy using memcpy function ptr1 = &record1; memcpy(record3, ptr1, sizeof(record1)); printf("\nRecords of STUDENT1 - copied from record1 " \ "using memcpy \n"); printf(" Id : %d \n Name : %s\n Percentage : %f\n", record3->id, record3->name, record3->percentage); // 3rd method to copy by individual members printf("\nRecords of STUDENT1 - Copied individual " \ "members from record1 \n"); record4.id=record1.id; strcpy(record4.name, record1.name); record4.percentage = record1.percentage; printf(" Id : %d \n Name : %s\n Percentage : %f\n", record4.id, record4.name, record4.percentage); return 0; }
record3 is a null pointer, copying to null pointer does not make any sense Please change that to this one ptr1 = &record1; record3 = &record2; memcpy(record3, ptr1, sizeof(record1));
Ali
How Write 2 different problems where they require different data structure to be efficiently solved ???
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi guys, so I am studying Operating Systems writing code in C. My professor explained us that, if I want a process to run something, I have to use the execlp instruction. That's fine, but this only works in UNIX environment, do you have any suggestion for Windows? I am basically writing two C programs, the former creating N processes that take directories paths via argv, creating N processes that, at the end, must use the /s command. So, I don't know how to do it, any suggestion?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
On my professor's slides the execlp is set in the "unix" part, and he didn't write it again for the "windows" part, so I don't really know how to run this thing
klimi
I don't really develop for windows but... Guessing by https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/execlp?view=msvc-170
Egro
Hey, how to start a application with c++ to store/save any file, similar to drop box. I want to build this project to learn c++
Egro
Thank you
Azhar
#include <iostream> #include<conio.h> #include<math.h> using namespace std; class A { int a, b, s, c, area; public: void triangle () { cout << "Enter sides of triangle"; cin >> a >> b >> c; s = (a + b + c) / 2; area = sqrt (s * (s - a) * (s - b) * (s - c)); cout << "Area of triangle" << area; } }; void main() { clrscr (); A obj; obj.triangle (); getch (); }
J
Hey, how to start a application with c++ to store/save any file, similar to drop box. I want to build this project to learn c++
https://firebase.google.com/docs/storage/cpp/start This might help you but I recommend reading cpp guides before that
J
/get cppbookguide
Azhar
What error are you getting?
Returning void Compiler error
Hello, anyone know how to use cmake checks whether the compiler is a mpi compiler(such as mpicc, which wrap link and include option). I used this sentence to check if(CMAKE_CXX_COMPILER MATCHES "mpi") before, but the intel oneapi new compiler location is something like /opt/intel/oneapi/compiler/2022.0.2/linux/bin/icx, which also matches string "mpi", which will confuse my detection. So, what it the proper way to check it?
moyo
#notename bingo
Ольга
Good afternoon everyone. I have a task that I can't solve. I need to move the columns of the matrix so that the product of the columns forms an ascending sequence. I had the idea to add the multiplication result as another row to the matrix and then sort by the last row. But it still does not want to go right. Perhaps in C there is an easier algorithm for moving columns depending on the value??? Thank you for listening. And I strongly ask for any help because I no longer know what to do
Ольга
#include <stdio.h> #include <stdlib.h> int main() { int i, j, lines, columns, *intMatrix; printf("Type the matrix lines:\t"); scanf("%d", &lines); printf("Type the matrix columns:\t"); scanf("%d", &columns); intMatrix = (int *)malloc(lines * columns * sizeof(int)); for (i = 0; i < lines; ++i) { for (j = 0; j < columns; ++j) { printf("Type a number for <line: %d, column: %d>\t", i+1, j+1); scanf("%d", &intMatrix[i*lines + j]); } } for (i = 0; i < lines; ++i) { for (j = 0; j < columns; ++j) { printf("%d\t", intMatrix[i * columns + j]); } printf("\n"); } int *mas; for(int i=0;i<lines;++i) { float dobutok=1; for(int j=0;j<columns;++j) { dobutok=dobutok*intMatrix[j * lines + i]; } mas[i*lines + j]=dobutok; printf("%d\t",mas[i*lines + j]); } int *Matrix2; Matrix2 = (int *)malloc(lines+1 * columns * sizeof(int)); for(i=0; i<lines+1;++i){ for(j=0; j<columns; ++j){ Matrix2[i*lines + j]=mas[i*lines + j]; } } for(j=0; j<columns;++j){ for(i=0; i<lines+1; ++i){ Matrix2[i*lines + j]=intMatrix[i*lines + j]; } } for (i = 0; i < lines+1; ++i) { for (j = 0; j < columns; ++j) { printf("%d\t", Matrix2[i * columns + j]); } printf("\n"); } return 0; }
Ольга
Maybe someone knows why it fills the array with incomprehensible zeros. Because it multiplies correctly and as soon as I want to change something in the output it no longer works https://www.onlinegdb.com/kz0AX1yCK
HELLO
Hi
Ramil
Can I ask what exactly is lint/splint?
Ramil
Is it really that important?
Ramil
I saw the website of splint.org, it was last updated in 2010
Pavel
Is it really that important?
I don't know what this is, so it probably not important 😂 Are you talking about linters (static code analysis)? I think there are many of them and the are pretty handy, especially for big projects
Pavel
But not "important" as to know them to program
Ramil
I meant how does it even help?
Pavel
I meant how does it even help?
Imagine you accidentally wrote some code where you access uninitialized variable (just as an example), then some linters can analyse your code and warn you that you have a potential error there. There are different static analysers, some can find really interesting mistakes.
Ramil
That does sound handy
Ramil
Thanks
Ольга
Hi to all! I really need a hint. Please tell me, is there a way for C to sort columns according to their sum? I will be very grateful for any help
Ольга
since C is turing complete -> yes
Maybe you have such an algorithm or at least a link to something like that? I've just been sitting on this task for a long time and I can't find anything like it
Dima
wtf lol
Flofy
Ok
Azhar
#include <iostream> using namespace std; class overloading { public: int x; void ip() { cout << "Enter Num : "; cin >> x; } friend int operator+(overloading &ob1, overloading &ob2) { return ob1.x + ob2.x; } friend int operator*(overloading &ob3, overloading &ob4) { return ob3.x * ob4.x; } friend int operator++(overloading &ob5) { return ++ob5.x; } friend int operator-(overloading &ob6, overloading &ob7) { return ob6.x - ob7.x; } void operator=(int a) { x = a; } }; int main() { overloading O1, O2, O3, O4, O5, O6; O1.ip(); O2.ip(); O3.ip(); O4.ip(); O5.ip(); O6 = ((O1 + O2) - (O3 * O4) * (++O5)); cout<<"Result : "<<O6.x; return 0; }
Nana
Pls how do I create a class that returns any invalid input from this program
Nana
#include <iostream> using namespace std; void intro(); class TestScore { public: TestScore(double array[], int size) { { double total; for(int count = 0; count < size; count++) { total += array[count]; average = total / size; } } } double getTotal() {return total;} double getAverage() {return average;} protected: private: double average; double total; }; int main() { intro(); int size; cout<<"Enter the size of the array: "; cin>>size; cout<<endl; double array[size]; for(int count = 0; count < size; count++) { cout<<"Enter score #"<<count + 1<<": "; while(!(cin>>array[count]) || array[count] < 0) { cout<<array[count]<<" is a negative figure\n"; cout<<"Enter a valid figure: "; cin.clear(); cin.ignore(100, '\n'); } } TestScore test(array, size); cout<<"The average is: "<<test.getAverage()<<endl; return 0; } void intro() { cout<<"\t\tThis is a test score class program in C++\n"; cout<<"\t\t---------------------------------------------\n"; cout<<endl; }