Posts by Carlos Henrique • 77 points
9 posts
-
0
votes0
answers21
viewsQ: Problems with setuid
I am developing a program that changes my process uid to 0 allowing me to start other root programs. mysu.c #include <stdio.h> #include <unistd.h> int main(int argc, char **args) { int…
-
0
votes1
answer56
viewsQ: Segmentation fault while reading file
I have an inputstream header. h that defines a struct having a string, an int and a readc Function. In this header I define the Function init receiving as parameter a string having the absolute…
casked Carlos Henrique 77 -
0
votes1
answer81
viewsQ: Problems with C socket
I have 3 functions responsible for creating a socket, sending data and receiving data. Function sock_create creates a new socket by returning an int of that socket, Function sock_send sends a header…
-
2
votes0
answers52
viewsQ: Run Activity from another app
Is it possible to run an Activity from another app? I don’t want to call it through an Intent, something like this: public class AnotherActivity extends com.otherapp.app.ActivityName { // Aqui vai…
-
2
votes2
answers51
viewsA: How do I point (with pointer, of course) to a string, so I can then print it?
*p = nome; // INCORRETA ATRIBUICAO In this snippet you are assigning a string to a char variable (*p is the memory address of the first char of the string) The right thing would be: p = (char*)…
-
0
votes1
answer52
viewsQ: Segmentation fault na Function read_line
I have a Function that returns a string from a row of a file, but when I run it I get a message from Segmentation fault. Here’s the code: #include <stdio.h> #include <malloc.h> #include…
casked Carlos Henrique 77 -
1
votes1
answer53
viewsQ: Power function returning incorrect values within the while loop
I have a function power that returns the value of a potentiation receiving the parameters n and p (n^p). Outside the loop while the function returns the correct values, but within the loop function…
-
0
votes1
answer298
viewsQ: Scanf function causing infinite loop
I have a simple code that converts a char in a int within a loop while, but when I execute and place the first char, the program goes into loop infinite, here comes the code: #include…
casked Carlos Henrique 77 -
0
votes4
answers158
viewsQ: printf function is not running after scanf method
Well my problem is this, I have a program that calculates the area of a circle, here’s the code: #include <stdio.h> #define PI 3.14 int main() { double radius; double area; printf("Program to…
casked Carlos Henrique 77