Questions tagged as 'c'

1
answer

How to change the size of a global vector of structures in C?

My idea is to declare a global vector of a x-structure, but I will only have the size of the vector in main. How can I declare the vector and then tell it the size of it? I have an equivalent solution in Java, but not in C.     
asked by 20.08.2016 / 22:34
1
answer

Read a specific sentence from a file and stop at it

I want to store a part of a file in a string : Bruno Mossa Rezende 5 2 7 6 22 22 0.13 8 19 141 0.17 260 2 320 5.42 43 22 6 0.90 0 0 5 From this file I want to store in a string "Bruno Mossa Rezende", I do not want the numbers at the moment...
asked by 20.08.2016 / 03:36
1
answer

Create dynamic structures starting from a text file?

I have data saved in a text file. I want to read the text file and store the data in my variables, and then insert them into my inserir_medico function that will use the data to create a concatenated List. The problem is that, I have a va...
asked by 22.08.2016 / 02:41
0
answers

Read TXT with Extended AscII

I made the following code to read a TXT file that contains extended char ascii table. int main(void){ printf("%c %c %c %c %c %c %c %c %c \n",205,187,186,187,200,201,205,188); FILE *ffpOrig=fopen("a.txt", "r"); for(;!feof(ffpOrig);){ unsigned...
asked by 15.09.2016 / 18:49
1
answer

What is the use of * in the expression "Foo * foo = new Foo" in C ++? [duplicate]

I was analyzing this question made in SOEN. There you are teaching to instantiate a particular class. I was able to understand more or less how it works, because when I use my example, it is giving error when compiling. class Pessoa {...
asked by 05.01.2016 / 15:50
1
answer

At the end of the String printout, the 0p always exits. Which is?

I made a code to accept only some characters read in one vector and move to another vector. In the case, the first user can type what he wants and the program keeps only digits, mathematical operations (+ - / * ^) and the letters p and i. I was...
asked by 10.09.2016 / 21:39
1
answer

Doubt with use of 'pthread' in posix

I am using the following routine with command pthread.h library: // // Declaração // pthread_t threads[NUM_THREADS]; // // Criacao // for(...) { pthread_create(&threads[i], NULL, MainTH, (void *) &thread_ar...
asked by 02.08.2016 / 14:44
0
answers

Library in C with auto checksum

I'm creating a library / library for Android in C, and I'd like to know how do I display its own checksum , so if you experience any " change " after compiling, % w / w% will change.     
asked by 19.08.2016 / 03:42
0
answers

This program is giving Runtime Error in uri, I would like to know where I am going wrong

#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main(){ short int numCasos, i = 1, j = 1, soma = 0; long long int num; scanf("%hd", &numCasos); while...
asked by 05.08.2016 / 20:15
0
answers

How to get the DateTime from the internet?

How can I get the current date of the internet, and convert the result to char *data_atual ? Example of the sites you want: nist.time.gov and / or time.windows.com . I would like two examples, one returning only the date...
asked by 16.08.2016 / 23:41