Dima
Anonymous
mk
Abhishek
Can doubly linked list implemented using single pointer ?
Igor🇺🇦
Anonymous
hai
Ihor
Packages in Java is a files with main? or without main, just simple file
Anonymous
Hello
Anonymous
s=a+b+c/2; is wrong. it's supposed to be s=(a+b+c)/2.0
Anonymous
and what you implemented is called Heron's formula
IAmMADMAX
Anonymous
Anyone using atom ide ? plz reply need help
Brent
Anonymous
Programmer
IAmMADMAX
mahdi13
hi
in vs code when i run the code i see just output
is there a way to see compile time?
g3rm4n
hey everyone, i need to write a C recursive function to square each number in array...
g3rm4n
i know how to square a given number but i was stack of calling to array
j
vector<vector<int>> getAdys(vector<vector<int>> cities, int n){
vector<vector<int>> v(n,vector<int>());
for (int i=0; i<cities.size();i++){
v[cities[i][0]].push_back(cities[i][1]);
v[cities[i][1]].push_back(cities[i][0]);
}
return v;
}
j
i get a segmentation fault
j
exactly at the point of the first push_back
j
why?+
Pavel
j
I wanted empty inner arrays
Pavel
I mean you address them by indexes 0 and 1 but are they filled?
j
yes, i filled them manually
j
vector<vector<int>> cities = {{1, 2},{3, 1},{2, 3}};
Anonymous
you declared the distance function ( float , float , float , float ) although you are passing only two floats , a=distance(x_1,y_1) its missing two more arguments . extern float area,x1,y10,x2,y2,x3,y3 also throws an error.
Pavel
yes, i filled them manually
Another question: you pass n as argument, to init v vector and then address it with values from cities? Is it checked that n is always greater (at least by one) than the maximum value that can be found in cities?
j
that's it
j
ty
Anonymous
you declared the distance function ( float , float , float , float ) a=distance(float , float ) its missing two more float arguments
Junaid
undefined reference to `WinMain'
Junaid
what does this means
Junaid
\collect2.exe [Error] ld returned 1 exit status
Junaid
what does this means
Anonymous
Try to Google
Junaid
#include<stdio.h>
int leftrotate(int a[],int n){
int temp=a[0],i;
for(i=0;i<n;i++){
a[i-1]=a[i];
}
a[n-1]=temp;
}
int leftrot(int a[],int n,int d){
int i;
for(i=0;i<d;i++)
leftrotate(a,n);
}
int mian()
{
int a[5]={1,2,3,4,5},d=2;
leftrot(a,5,d);
return 0;
}
Anonymous
#include<stdio.h>
int leftrotate(int a[],int n){
int temp=a[0],i;
for(i=0;i<n;i++){
a[i-1]=a[i];
}
a[n-1]=temp;
}
int leftrot(int a[],int n,int d){
int i;
for(i=0;i<d;i++)
leftrotate(a,n);
}
int mian()
{
int a[5]={1,2,3,4,5},d=2;
leftrot(a,5,d);
return 0;
}
What is int mian() ?
Junaid
Anonymous
You have no int main() function
Mateo
ahh the mian cat
Mateo
Leon
Anonymous
Hey .Write a program to input Marks of 50 students and display marks of top 3 students. What will be the condition for second and 3rd student . while solving without using array
Anonymous
Anonymous
Think of it as updating a high-scores list.
Anonymous
Anonymous
It would be better to start iterating at int i = 3 but still rearranging x, y, z.
Anonymous
I need help using dspic30f4011 i2c
Anonymous
Anyone can help me out?
Anonymous
Anyone can help me out?
We don't know anything about it. All that the search results say is that it is a microchip that controls a blinking LED, programmed with the "Mplab software & Microchip C30' compiler.
Thierry
Is there a c(99) repl shell?
like cling for c++
Anonymous
I'm not sure if this is what you mean... I never got this to work BTW. https://securityonline.info/wcc-the-witchcraft-compiler-collection/
Thierry
What's the benefit of writing a simple for loop in C like this
long j;
for (j = 0; j < N; j++) {
// some computation
}
Instead of
for (long j = 0; j < N; j++) {
// some computation
}
Anonymous
Thierry
Why, my professor is doing it and he's been coding C since 30 years
Anonymous
Thierry
Anonymous
Anonymous
Whatever, it doesn't mean your professor good
Thierry
Anonymous
Lol, learn some English...
Thierry
No need to be cocky
Elijah
for this
long j;
for (j = 0; j < N; j++) {
// some computation
}
// some computation with j is possible
while this
for (long j = 0; j < N; j++) {
// some computation
}
// some computation with j yields an error
// j is block scoped in the loop
Thierry
Anonymous
Thierry
Thanks 👍 this is what elijah pointed out
Anonymous
Hello, must I define a default constructor for a class if for some reason it I create a constructor with parameters and would use it for just special cases?
Like for the default constructor, I create a prototype in class without ever defining it?
Thierry
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Sometimes you would use constructor with parameters just to avoid calling the class setters later
MᏫᎻᎯᎷᎷᎬᎠ
Anonymous
Anonymous
👌👌