Posts by José Cunha • 411 points
11 posts
-
1
votes1
answer81
viewsQ: Find path of a file only given the name
I am trying to find the path of a file just knowing its name. I have tried several ways including pwd but it’s no use to me. There will be some way to do it ? (I have assurance that this is the only…
-
1
votes1
answer560
viewsQ: Get ID of a process
I wanted to get an ID of a process because I would like to use the kill() to send signals from a process to that. I know that to get the ID of the process itself is used getpid() however do not know…
casked José Cunha 411 -
1
votes0
answers51
viewsQ: Change contents in a given position in a multidimensional array within a structure
I’m having trouble modifying the content in a given position of a multidimensional array that is within a structure. I have two structures struct TabelaFilial and struct ArrTabela. The structure…
-
0
votes2
answers174
viewsQ: Use pointer on struct
I wanted to know how to access a certain element of a struct the way I’m defining it. Here’s my struct: typedef struct { char *produtos[200000]; int contador; } Produtos,*ProdutosP; Defini ProdutosP…
-
0
votes1
answer40
viewsQ: Problems in a string array of a structure
I’m having a problem with an array of strings I’m trying to access from a structure. The structure is placed in a header.h which has the following format : typedef struct { char *produtos[200000];…
-
3
votes1
answer94
viewsQ: Run a list of executables
I am trying to implement a program that runs concurrently a list of specified executables as command line arguments, considering executables without any arguments of their own. The program must wait…
casked José Cunha 411 -
2
votes2
answers2037
viewsQ: Insert widget into binary search tree
I’m having a hard time adding an element to a binary search tree. The function returns 1 if the element to be inserted is already in the tree and 0 otherwise. The function return works well but when…
casked José Cunha 411 -
1
votes1
answer134
viewsQ: Main for function on linked lists
I’m having a hard time creating a main to test if my function is going well. My program is as follows: : Lint fromArray (int v[], int N) which, given an array v with N elements, ordered in ascending…
-
0
votes1
answer64
viewsQ: Problem in the supply function
I’m here with a problem in this role int supre (char S1[ ], char s2[ ]) , which calculates the size of the largest S1 suffix prefix of s2. For example if you have supplied ("cheat", "totality") you…
-
5
votes4
answers199
viewsQ: Problem accessing array element
I have a problem in the function below that truncates all words to have at most N characters. For example: if the string "freedom, equality and fraternity" means the invocation of truncW(t,4) should…
-
16
votes5
answers2736
viewsQ: Test whether all characters of the first string also appear in the second
I’m trying to do that function with the help of the functions strcmp() and strncmp() and I’m not having much success. Let’s say I have the string char s[] = "abc" and another string char v[] =…