Posts by krystalgamer • 531 points
20 posts
-
0
votes0
answers53
viewsQ: Why can I restore old ESP value
Well I have here a question that involves Assembly and C. The variable format has more than 4 bytes, yet I can do pushfrom it without using cast and return the old ESP value after push. How is it…
-
1
votes2
answers174
viewsA: Use pointer on struct
You have defined products as an array of pointers to strings. To access the first character you only need to use one more [] In this case p->produtos[0][0]. The first number between the…
-
3
votes4
answers2408
viewsA: What is buffer overflow?
Since the buffer is the space that each variable has in a program, this space is limited. For example, each char is usually a byte. Buffer overflow means writing beyond the space of the variable by…
-
3
votes2
answers761
viewsA: How to debug programs in C by Command Prompt?
To debug with Comand Promp there are only two options.Or use a Debugger with no graphical interface as is the case with GDB, or use text output. This is through printf or even fprintf can "print"…
-
2
votes2
answers279
viewsA: Error including library using Linux
To complete the answer above me, if you really need to include all these libraries follow these steps: Install ncurses and download the gconio file.…
-
1
votes1
answer146
viewsA: Struct pointer cast doubt
First of all header_t* is a pointer to the type header_t. Answer The pointers for the void type void* are pointers for any type. They are used when the programmer does not know what kind of…
-
2
votes2
answers12933
viewsA: Multiple conditions on an if
Should be && instead of ||. If the bars were true, one condition would be true to print the message. That is, if meia for a n the message is printed because n != s. If it were the &&…
-
1
votes1
answer79
viewsA: Cmake Makefiles generator problem
I found a solution to this a long time ago. The solution is to use the mingw-w64 instead of the msys2.
-
2
votes2
answers7523
viewsA: conio. h library in C language for Ubuntu
You are not allowed to put the file in the folder. To do this you need to go to where you downloaded the gconio.h and run the following command sudo cp gconio.h /usr/include/gconio.h. Will ask you…
-
0
votes2
answers208
viewsA: Problem with threaded list pointer offset
It is not a solution, but a suggestion. Why waste so much time using chained lists if you can use Arrays? When one is learning one cannot forget the basics. To my see chained lists for a game does…
-
0
votes1
answer253
viewsA: Problem with Allegro image call by Mac C terminal
First Are you sure that the allegro is installed? Even if you have go to your directory toolchain or of IDE(must be the Xcode) and see if inside the folder include has a folder there called…
-
0
votes2
answers2642
viewsA: Physically delete a struct type record
Hey, you should just post a bunch of code 'cause no one’s gonna read it all. First of all, this is an addition to what Maniero said. Arrays serving as queues is not a good idea, because a array has…
-
0
votes1
answer79
viewsQ: Cmake Makefiles generator problem
Good ones I’m following this tutorial on how to install Allegro 5 with MSYS2. But I have a problem. At the moment I will run the command cmake \ -G"MSYS Makefiles" \…
-
2
votes1
answer1145
viewsA: Compiling with g++
Unable to link using the flag -l because the name of the library should be libglfw3dll.a. Because as I mentioned in one of my old posts it is mandatory to have lib in the name.…
-
2
votes1
answer79
viewsQ: Doubt with sockets(Winsocks)
Good, I am learning how to work with sockets (never worked) and decided to start with winsocks. I am currently using winsock2.h and in the tutorial I’m following I came to a part that I can’t…
-
0
votes2
answers335
viewsQ: Good graphical library for beginners?
Well, I know that in stackoverflow I shouldn’t get too caught up in the subjective when it comes to questions, so I’d like you to answer them based on facts and not based on your experience. Well…
casked krystalgamer 531 -
1
votes2
answers400
viewsA: Reading an array of a file
Verified results I compiled your program (after mine amendments) and I’ll tell you it doesn’t work. The function you should use is fgets. See this. Solution To read a file using fgets we loop, it…
canswered krystalgamer 531 -
2
votes2
answers362
viewsQ: Is it necessary to invoke the functions "Showwindow" and "Updatewindow"?
I recently made an introduction to Windows API and I’m already in the window-making part. In one of the first applications I created I had to use ShowWindow and UpdateWindow after creating a window,…
-
5
votes2
answers225
viewsA: Source code in Projects
I cannot comment and as I do not know which compiler you are using I will put here a general answer. You will need to create a static library. Let’s assume it’s called liblog.a in your compiler you…
-
1
votes3
answers557
viewsA: Convert "unsigned int" to "unsigned char" vector?
The answer you chose as best can be responsible for Undefined behaviour this is may change chunks of memory that do not belong to you causing crashes or bugs. If I were you I would use a [Union][2]…