Questions tagged as 'c'

1
answer

Help with nested structs in C

I was creating a list with C and using a struct , after finishing I tried to see what was changing with a nested struct , I created two structs basic, one getting only one value, and other receiving this first and a...
asked by 24.05.2016 / 06:34
0
answers

Can anyone help me with the greedy algorithm problem?

The problem asks you to do the following: Cut a steel rod of length n to obtain the maximum possible revenue (Rod Cutting). Present in algorithm with backtracking (I already did) and find a solution with greedy algorithm. Algorithm code made...
asked by 09.05.2016 / 14:27
1
answer

QuickSort with last element as pivot

The following code should receive a string of characters separated by space and sort them: #include <stdio.h> #include <stdlib.h> int particiona(int *vector,int inicio,int fim){ int i,j,guarda,aux; i = inicio-1, j = inicio...
asked by 26.03.2016 / 02:18
1
answer

Find path of a file only given the name [closed]

I'm trying to find the path of a file just by knowing its name. I've tried it in many ways including pwd but it does not do me any good. Is there any way to do this? (I have a guarantee that this is the only file with this name, so ther...
asked by 20.05.2016 / 00:03
0
answers

Change content 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 inside a structure. I have two structures struct TabelaFilial and struct ArrTabela . The struct TabelaFilial structure is being...
asked by 10.04.2016 / 21:26
1
answer

How to block the insertion of an information using a List

Well I'm using list structure and I've tried everything and so far I have not been able to. I'm trying to get the product entity to ONLY receive the CPF from a vendor. The Product entity works when the Person entity has nothing inside or until I...
asked by 29.02.2016 / 00:47
2
answers

Why declare pointer to array if arrays are already pointers?

If a char array is already a pointer, why declare a pointer to the array? And what's the difference between char exemplo[10] and char *exemplo[10] ?     
asked by 08.10.2015 / 03:19
1
answer

Pass C struct to moon script

When I have to pass my structure Book to the script in Lua , the method writes the value to nil .    How do I pass the Book structure to my moon code? main.c: #include <lua.h> #include <lualib.h> #incl...
asked by 18.04.2016 / 08:41
2
answers

Redirect Flex input to a string

Good, I have a flex file and a routine in C to check text writing. I've been testing on the command-prompt using test < inputFile What I wanted now was to be able to indicate in my C file a parameter (a string) that it then check...
asked by 19.02.2016 / 17:36
0
answers

How to use dialogs in GTK + [closed]

I've been searching the internet for how to use dialogs in GTK +, and I ended up finding a handful of articles in English and none in Portuguese. Reading the articles in English, since I have an understanding with this language, I could n...
asked by 28.12.2015 / 17:55