Vlad
Like &(--(*p)) + 7
dafuq is that? Xd
Nils
Vlad
No idea lol
Doing that on the two lines is too oldskool, eh?
Vlad
Also reassigning pointers like that is a huge code smell
Vlad
Also reassigning pointers like that is a huge code smell
It almost always wrong, except for the cases where you really know what you're doing.
AJ
Hi
Hi
Anonymous
And also you have flag = 0 . and condition to stop the loop .flag < 5 You can use for loop For (int flag = 0; flag < 5; flag++) { }
Andrew
Thanks !!
Anonymous
Thanks !!
you are welcome 😊
Anonymous
void main (){ int seq[] = {}; int flag = 0; while(flag < 5){ printf("Write a whole number \n"); scanf("%d",&seq[flag]); printf("%d \n" , seq[flag]); printf("This is flag : %d \n", flag); flag++; } } why am I getting stack smashing detected. I'm sorry I'm newbie.
void main (){ int seq[5]; for(int flag = 0; flag < 5; flag++){ printf("Write a whole number \n"); scanf("%d",&seq[flag]); printf("%d \nThis is flag : %d \n" , seq[flag], flag)); } }
su
Like &(--(*p)) + 7
&seq[flag] эт полная хуйня
Nils
Wojak
Please help me know what I'm doing wrong here . The program is of implementing Queue using Stack #include<bits/stdc++.h> using namespace std; stack<int>a; int calc(stack<int>b) { stack<int>m; for(int i=0;i!=m.size();i++) { m[i]=b.pop(); } return m; } int main() { stack<int> c; c.push(20); c.push(30); c.push(40); c.push(50); c.push(60); int *r=calc(c); for(int i=0;i!=c.size();i++) { stack<int>a=*(r+i); } a.pop(); }
Vlad
Also pass by ref instead
Vlad
And your m stack is empty
Vlad
Moreover your function doesn't do anything useful
Vlad
It just copies some data for no particular reason
Vlad
Yes
And why would you implement queue via stack?
Vlad
They are opposites of each other
Wojak
*the Question
PO
hi
PO
guys, how can I use the swith with an array like expression and int case?
PO
I think I found it
PO
http://www.java2s.com/Code/C/Language-Basics/Switchwithintcase.htm
PO
What do you mean by that?
Int *array; Switch (array){ case "1" : Printf(); break; }
Vlad
Vlad
Also why would you switch case on a pointer?
Vlad
because I have 10 cases
Do you compare address?
PO
For each case when an int is 1, it's case"1" and it should print 1
PO
You need strcmp for that
But my friends have done with switch
Vlad
if(strcmp(str, "1") == 0) printf("1");
PO
PO
My bad. Fixed
You mean for 10 cases I should do that, yes?!
Vlad
But my friends have done with switch
And it worked with user inputed strings?
Vlad
PO
if(...) else if(...) .... else
How many times should use if and when else if and else?!
Vlad
Pretty straightforward
Vlad
Yes
Were they using C?
PO
Were they using C?
The whole program
Anonymous
how the blender 3d application is made
Anonymous
how the blender 3d application is made
Anonymous
Can you help me ? 😊
Vlad
The whole program
In C you can only use integer values(also single chars) for a switch clause
Vlad
Maybe single chars is what they did
Vlad
how the blender 3d application is made
https://github.com/blender/blender
Pavel
how the blender 3d application is made
It's grown from in-house editor of one animation studio. Aand.. it's written by programmers.. probably?
Pavel
I need a definite answer, I am sorry. Can you help me ?
You expect someone to tell you the complete story of Blender creation with all the major features design explanation?
Vlad
I need a definite answer, I am sorry. Can you help me ?
There's no definite answer have you seen its repo size?
Anonymous
Test
V01D
Test
Test Program exited with return code 0. (0x0).
V01D
yes, I am very curious. Sorry to trouble you
You do know it is open source, right? And you should take a look at graphics librarys for C++. (I am just assuming C++ is better because of threading and a more modern interface. Don't quote me on that.)
DIVAKARAN
/get cbook
Anonymous
C++ practice question
Anonymous
Can someone help me with a question?
Anonymous
Yess
Anonymous