eli
in Linux there should be built-in compiler g++. Mingw is for windows and not needed to be installed in Linux, I think
shuzuya
I will live boot...I used puppy and Proteus but am thinking of mint
christian
Hello, I have a doubt Actually for c++ , I am unable to setup VScode in Linux. I have downloaded VScode but for coding....I am unable to understand that how I can setup minGW in Linux
In Linux there's a pre installed c compiler (gcc) so after installing VS Code and the C/C++ extension, you write your c code, save it then go to the terminal and type gcc -g [appname.c] You will see an output file (a out) If you want a custom name for your output file, you compile as follows gcc -g [appname.c] -o [customname] If it compiles with no errors, you type ./a.out Or, if you provided a custom output file name type ./[customname] If these steps don't work, feel free to let me know
J
Windows crushed and I cannot get to repair with recovery but I can access the files when I boot with Linux...so now am asking if there is a way to extract the softwares that were in windows partition as I can with the other files
If most of the programs reside in program files or Programs Files x86, You can copy those with cp or using a file manager. If it is an older version of Windows(I don't know about newer ones), Copy Appdata from your Users folder.
J
Hello, I have a doubt Actually for c++ , I am unable to setup VScode in Linux. I have downloaded VScode but for coding....I am unable to understand that how I can setup minGW in Linux
I don't know about VSCode but it is easier via terminal. You can use g++ or my favorite compiler clang++. Just cd into the folder. ie, If my program is in Documents folder, I will do cd ~/Documents g++ my_program.cc -o my_program.o And run the program using ./my_program.o //If you use clang, you can replace g++ with clang++ //Also, learning about make files will give you better advantage
J
Or gcc
I wouldnt use gcc since g++ is better for c++ programs provided I don't have to use any specific flags
christian
I wouldnt use gcc since g++ is better for c++ programs provided I don't have to use any specific flags
Oooh, I don't code in c++, i code in c that's why I use gcc 😂
Levi
https://itsfoss.com/run-c-program-linux/
Marcio
On a course offered by IBM ar EdX, a definition of an operator (+, for example) says that the first argument is implicit (accessed through this->) but Bjarne, on his “The C++ Programming Language 4th edition”, explicit work with 2 arguments. Then I ask: what form works? T operator +(T arg2) {…} or T operator +(T arg1, T arg2) ?
Grigoriy
How to create class by std::make_shared with protected constructor? class TObject { protected: TObject(void) { // the first phase of init ... } void init(void) { // the second phase of init ... } public: shared_ptr<TObject> make(void) { // Error. TObject::TObject is protected here. shared_ptr<TObject> clObj = make_shared<TObject>(); clObj->init(); return clObj; } }
McLean
/get resources
Tushar
guys, how do you check whether a directed graph is connected or not using DFS search?
Roger
BFS
Anonymous
/get
Artur
You can’t, The purpose of it is to inherit from the class but the destructor must be virtual and public
shuzuya
Question how does multiprogramming languages go about like a program written in c and java
Ethan
Question about bit fields I have been searching long and wide for a solution, mostly found its impossible, but maybe someone here knows. Im trying to find the size of a part in bits within a struct? It has been defined using bit fields
Anonymous
I am getting black space in vs code output terminal after enabling clear previous output feature of code runner extension How do i solve this?
UrCodeBuddy️ 💻
am stuck at merge sort, can someone please message me? i need some real help
Ludovic 'Archivist'
am stuck at merge sort, can someone please message me? i need some real help
Merge sort is partially already a part of the standard library as std::merge merges 2 sorted spans into another (for a copying merge sort). You should look at what it does and think about how you could use that to sort an array, past that and a little thinking and you should be more ready to implement it
Miki
An array is said to be vector array following this conditions :- 1)it contains atleast one odd value. 2)the maximum value of an array is must be even number. 3)every value of odds in the array must be greater than every value of even numbers exept the maximum even number Please help me to write this code in c++ 🤲🤲🙏🙏
Anonymous
Hello everyone, im a C++ student from europe 👋! Hope to learn from your experience
Caio
Hi! So, I'm practicing pointers and LinkedList in C. I have this function "add", for adding a new node to the LinkedList. I initialize the linked list struct as null: Node *list = NULL Then I pass this Node to the add function which has the following definition: void add(Node *n, int value); First I create the struct representing the first node, called p. Node *p = malloc(sizeof(Node)); p->value = value; p->next = NULL; So far, so good. The second thing is checking whether the received pointer is null or not, so as to define it as the first item on the list. if (n == NULL) { n = p; return; } This is where I don't get it. The address of p is set to n, but just within the scope of the function add. When I get back to main, the address of *list is still NULL. I'm not passing it by value, but by reference, but it's clearly not working and I'd like to understand why. Ty. I'll try to send the whole code on a link.
Caio
https://pastebin.com/7iJFMMDZ
Guljar
#include<stdio.h> #include<conio.h> main() { void add(int x, int y); void sub(int x, int y); void mul(int x, int y); void div(int x, int y); int a,b; printf("enter a first number"); scanf("%d",&a); printf("enter a second number"); scanf("%d",&b); add (a,b); sub(a,b); mul(a,b); div(a,b); getch(); } void add(int x,int y) { int c; c=x+y; printf("%d two number is add",c); } void sub(int x, int y) { int d; d=x-y; printf("%d two number is sub",d); } void mul(int x, int y) { int e; e=x*y; printf("%d two number is mul",e); } void div(int x, int y) { int f,e; f=x/y; e=x%y; printf("%d is the quetent",f); printf("%d id the remender",e); }
Guljar
#include<stdio.h> #include<conio.h> int main() { int a,b,c,d; printf("plz enter a first number"); scanf("%d",&a); printf("plz enter a second number"); scanf("%d",&b); c=a+b; d=c-b; printf(" %d two number add",c); printf(" %d two number add",d); getch(); }
Caio
I think the problem in your code is that you try to implement the list inside a node struct, the better way is to split this into two structs: Node and List. Node is a pair of pointer and value, List is a pointer to the first Node or nllptr. You add function than gets passed a List* instead of Node* and your current problem should be solved
The list implementation actually works. The struct has a pointer to the next struct. I'm not understanding why I'm attributing the pointer p to the pointer n, but when I get off the scope of the "add" function the *list pointer doesn't have the value of p. *list is the struct initialized as null and used as the argument to the add function.
Anonymous
The list implementation actually works. The struct has a pointer to the next struct. I'm not understanding why I'm attributing the pointer p to the pointer n, but when I get off the scope of the "add" function the *list pointer doesn't have the value of p. *list is the struct initialized as null and used as the argument to the add function.
I dont think it actually works, try to look at your <lista> variable in main with a debugger, you initialize it as a nullpointer which you then pass on to your add function. Add then tries to write the new Node <p> into an invalid memory location. You need something like this: struct List{Node* head} , then you can assign <p> to List.head
Caio
I dont think it actually works, try to look at your <lista> variable in main with a debugger, you initialize it as a nullpointer which you then pass on to your add function. Add then tries to write the new Node <p> into an invalid memory location. You need something like this: struct List{Node* head} , then you can assign <p> to List.head
I expressed myself poorly. This implementation, with the list initialized as null doesn't work the way I liked. Before this, I was initializing the list with some random value and then passing it to the add function. It worked this way, but I didn't want to implement it like that, having to initalize the list manually and then passing it. I wanted the 'add' function to identify "oh, the list is empty, so this item will be the first" and assigned the first value to the list initialized as null.
HemNetcher
/notes
Anonymous
/notes
Anonymous
/get stop_teaching_c_as_cpp_preamble
HemNetcher
#nousingstd
HemNetcher
#noendl
Jorit
#cbook
Miki
Show your code
I don't start it correctly
kherlepha
https://www.go-alpha-ng.com/?f=743658
Anonymous
Help to write a c++ program that include the concepts of control statement,arrays and function s,class and objects, inheritance , constructors and destructors ..using comments in the program
Anonymous
Hello, I'm Baihaqy from Indonesia, I have experience programming in C and C++. I hope I can help, Thank you. Greetings everyone 😊
Anonymous
Thank you:-)
🌻
Hi I'm studying computer science, and I studied CPP but I would love to specialize in it. If there is anything here that is an expert in the language and wants to teach paid private lessons - send me a message💜
🌻
I know , but sometimes when you study with expert he / she can greatly accelerate the pace of learning because they know what to focus on
hades
🙏
Rue Coco
Hie
Roman
Hi. Has anyone here studied Array Based Linked List ? I’m having an issue in that & I wanna discuss it with someone.
McLean
Hie
Hie coco
Shubh Joshi
Which is better to solve problems Codechef or codeforces?
Anonymous
Cc i think
Nana
Hello guys
Nana
Pls what is the meaning of a driver program?
klimi
Pls what is the meaning of a driver program?
communication between kernel/app with hardware
✍🏾👨🏾‍💻G(T)<=>K(S)⚽️🏃🏾
/get c++_isnt_c_with_classes
✍🏾👨🏾‍💻G(T)<=>K(S)⚽️🏃🏾
/get cpppattern
Anonymous
Hello 👋
Anonymous
Pls I want to start c/c++ programming
ɛ n h ᴀ n c ɛ ґ 🧟‍♂️
I promise you nobody’s gonna teach you Piece of advice from a beginner like myself 1. Get your hands dirty 2. Repeat 1 over and over again Go to YouTube Type something like “Learn c++” I believe it’ll be a good way to start
Madhav
if class functions are implicitly inline then why is it adviced to explicitly declare the class functions inline ?
Ayo, anyone imgui developer here?
Anonymous
Pls anyone to teach me c/c++ from scratch pls 🙏🏻🙏🏻🙏🏾🙏🏿
Boilse
/notes
J
/get ide
Anonymous
Hi guyz How can read a text file &amp; put the data of that to a structure? (c++)
Jayans
/get -freeprogrammingbooks
Jayans
/get -cppbookguide