eli
in Linux there should be built-in compiler g++. Mingw is for windows and not needed to be installed in Linux, I think
christian
shuzuya
I will live boot...I used puppy and Proteus but am thinking of mint
christian
J
Or gcc
I wouldnt use gcc since g++ is better for c++ programs provided I don't have to use any specific flags
\Device\NUL
J
christian
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
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++ 🤲🤲🙏🙏
\Device\NUL
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
Anonymous
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.
im not sure if you are using c or c++ ? Is add a function or member method? Try posting a link so we can check out your code
\Device\NUL
Anonymous
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.
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
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();
}
Anonymous
Anonymous
HemNetcher
/notes
Anonymous
/notes
Anonymous
/get stop_teaching_c_as_cpp_preamble
HemNetcher
#nousingstd
HemNetcher
#noendl
Jorit
#cbook
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
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
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💜
Anonymous
🌻
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
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?
Prince Of Persia
✍🏾👨🏾💻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 ?
Null
ᅠ
Ayo, anyone imgui developer here?
Anonymous
Pls anyone to teach me c/c++ from scratch pls 🙏🏻🙏🏻🙏🏾🙏🏿
Alfredo
Boilse
/notes
J
/get ide
Anonymous
Hi guyz
How can read a text file & put the data of that to a structure? (c++)
Jayans
/get -freeprogrammingbooks
Jayans
/get -cppbookguide