Posts by André • 98 points
10 posts
-
2
votes3
answers611
viewsA: Incorrect counting in electronic voting program
Null, C1, C2, C3, C4, are now global, were missing two vote() and break, it was necessary to change the declaration of variables of the voting function, and instead of using recursive function you…
-
0
votes1
answer41
viewsQ: script called once but turns two processes
I have here a script to test a function in the background. When I spin is launched two processes and I do not understand why. One stops at the "Sleep 20", and the other wheel eternally. #!/bin/bash…
-
1
votes3
answers181
viewsA: Use of data type modifiers
The difference of an unsigned type in summary, is the treatment to the first bit in the set of bits of storage of this variable in memory. on a 64 bit system would normally be this one 1 on the…
-
0
votes3
answers336
viewsA: Problem regarding type in function with variable parameters in C
If working only with numerical values, casting works well with array. #include <stdio.h> double soma(int qtd, double s[]){ double ret=0; for(int i=0;i<qtd;i++){ ret+=s[i]; } return ret; }…
-
0
votes3
answers336
viewsA: Problem regarding type in function with variable parameters in C
Face with explicit function cast. #include <stdio.h> #include <stdarg.h> double somaVariaveis(int qtd, ...) { va_list args; int i; double soma = 0; va_start(args, qtd); for(i = 0; i <…
-
0
votes3
answers8881
viewsA: How to import functions from another C file?
Here is an example of the example file. c que Voce ira compile (/home/Andre/Workspace/c/example. c) #include </home/andre/workspace/c/andruida.c> int main(){ printa(100); printo(); return 0; }…
-
0
votes2
answers69
viewsA: Script does not show the entire path
Tries x=$"$(find -type f)" for i in $x do echo -n "$i: " wc -w $i|cut -d " " -f1 -z echo -n " palavras" echo done
-
0
votes4
answers684
viewsA: Variable interpolation in shell script that returns the output of a function
Maybe function data_hora_atual { echo `date +"[%d/%m/%Y %H:%M:%S]"` } obter_data=$(data_hora_atual) data_hora=$(echo "${obter_data}") echo ${data_hora} sleep 1 obter_data=$(data_hora_atual)…
-
3
votes2
answers1017
viewsA: syntax error near Unexpected token `fi' Linux
It seems that there are missing spaces between the [! leave them like this [ !. STEAMCMDDOWN="https://steamcdn-a.akamihd.net/client/installer /steamcmd_linux.tar.gz" STEAMDIR="~/steamcmd" if [ ! -d…
-
2
votes3
answers541
viewsA: Bash - Save errors in a variable
maybe LOG="/home/control/log.txt" tar -zcf teste.tar.gz teste 2>>$LOG