Questions tagged as 'c'

1
answer

Union of vectors, adding the vectors?

I created the following function to join two vectors (not being able to repeat an equal number), follow the function and comments showing what I did and the error that is giving: void uniao(int *A, int *B, int qnt) { int C[qnt*2], cont, c...
asked by 16.09.2015 / 19:15
1
answer

Multiplatform C program

If I make a program in C and do not use any Windows library by leaving the program completely pure in C can I compile it for Linux too? Will it work normally?     
asked by 04.08.2015 / 19:22
2
answers

Code compilation [closed]

Please help me, I can not compile this code: Until the command prompt does not start anymore #include <stdio.h> int main() { int x,y,z; int a=0; for (x=0;x<=1;x=x+1) for(y=x;y<=1;y=y+1) for(z=y;z<=2;z=z+1)...
asked by 06.09.2015 / 02:54
1
answer

Remove odd numbers from a stack

In C, how do you remove only odd numbers from a stack? I was thinking of removing item from item and passing to a vector, however the stack size is not given.     
asked by 05.07.2015 / 03:39
1
answer

Extract data with bitwise and bitwise operators

Well, I'm having some trouble separating parts of the date through bitwise operations. date format: yyyy-dd-mm int menor_data(int date1, int date2) { int day1 = (date1 >> 8) & 0xff; int month1 = date1 & 0xff; i...
asked by 29.11.2015 / 12:59
2
answers

Generate random numbers from a predefined set

How to generate a random number in a range of non-sequential numbers. For example, a function that randomly chooses between values, 3, 10, 20, and 2334 in the C language     
asked by 15.06.2015 / 21:23
1
answer

Query vector from one table to update another in C

Hello. I'm new here and I do not even know if I was very objective in the title. But let's go. I'm almost finishing my final C Algorithm project, and I'm not able to update an item from one table with information from another. More specific:...
asked by 05.06.2015 / 02:58
1
answer

Copying from a file to an array

Good night, I have a problem, I want to copy an information from a file to an array that dynamically allocates, the text file contains this: ....* *.... ..... .*... ..... (5 rows and 5 columns that will go to the array that I used using real...
asked by 09.08.2015 / 03:07
1
answer

Storing a vector of characters within a heap memory

I would like to know how to sort a character set into a vector, and store it in the heap memory.     
asked by 24.04.2015 / 18:43
1
answer

I am creating a queue, and I can not develop the function logic so that the previous object assumes the new released position - C #

I'm using unity3D, so my queue is made up of GameObjects, there are 7 GameObjects queued next to each other and my purpose with this code is that with every click of the user - " SimpleMove Function "- the objects move forward, except the last...
asked by 10.07.2015 / 21:48