Posts by sgtcortez • 226 points
8 posts
-
1
votes2
answers91
viewsA: free() does not work in Dynamic Stack code
You see, you’re letting the compiler do the allocation, and then you try to release that memory (if I’m not mistaken, the behavior of that is undefined, which can give you a lot of headaches). int…
-
0
votes1
answer54
viewsA: SMTP error - Gmail SMTP error
I believe there was a typo. You have: $mail->SMTPSecure = 'tsl'; Try changing to: $mail->SMTPSecure = 'tls';
-
3
votes2
answers166
viewsA: Doubt with "Return" in functions (java)
You probably played with another language (javascript, php, python) which are not strongly typed and then came to Java. In Java, what you want to do is not possible, but there is a way to do it. As…
-
0
votes2
answers28
viewsA: Data Calendar updating alone
In java we do not have passage by reference, only copy, however, the copy points to the same references. So when you do: data.add(Calendar.WEEK_OF_MONTH, prazo); is changing the original variable.…
-
0
votes1
answer48
viewsA: in C. I passed a vector to a function and changed it inside. Why didn’t you change my vector in the main function? because I passed a pointer
It didn’t change because int* matriz is a copy of the pointer. The pointer points to the same region, but it is not the same pointer. Does that explain why: matriz = ptraux only function within the…
-
0
votes2
answers76
viewsA: Error while creating string array
The post is old, and already has a correct answer, however, I believe it can help new users. Do not use scanf to get keyboard input. Scanf has no limit set, if the user input is greater than the…
-
1
votes1
answer115
viewsA: Map vector in Java
I don’t find any example of similar implementation on the internet It’s because it doesn’t make any sense. I want to make a few points here before I reply: What you are doing (or asked to do) makes…
-
1
votes1
answer39
viewsA: Doubling element of a double chained list
welcome to Stackoverflow Your problem, is that you’re making one while(p != NULL), however, you never change the variable p, so it will have an infinite loop. novo = malloc(sizeof(struct tNo));…