Questions tagged as 'c'

1
answer

How to correctly call a function through another function in C?

I have the following functions: int testarDivisibilidade(int dividendo, int divisor); int divisibilidade3(int num); And the following variables: int dividendo; int divisor; With the function testarDivisibilidade , I'll check if t...
asked by 10.05.2017 / 17:50
1
answer

Array storage

I have a question about storing information in array, I thought that when inside a loop, an array of size 200, for example char nome[200] it would be filled continuously until no more space is left to save the information, causing the sys...
asked by 08.03.2017 / 02:17
1
answer

C - Structures for point, polygonal line and polygon

Good evening The exercise asks me to implement three structs: Point (X and Y coordinates), polygonal lines (sequence of 2 to 100 points that are the vertices along the line) and polygon (sequence of 3 to 100 points that are the vertices along...
asked by 29.05.2017 / 04:13
1
answer

Is there IDE to develop GTK graphical interface?

I want to develop programs with interface for Linux. My question is this: Is there IDE to develop graphical interface in GTK in the same style as Visual Studio from Microsoft? The style I'm referring to is the "drag and drop" used to create inte...
asked by 22.04.2017 / 23:23
1
answer

What are the ascii codes of the directional arrows on the keyboard?

I'm working on a C project and came across the following method static void keyEvent( unsigned char key, int x, int y) { /* quit if the ESC key is pressed */ if( key == 0x1c ) { printf("*** %f (frame/sec)\n", (double)count/arUt...
asked by 26.04.2017 / 16:06
2
answers

How to test a number and tell whether it is prime or not?

I have a small problem, after the first time the code executes it only shows "NOT PRIME" and no longer shows "PRIME", where "NOT PRIME" would be for non prime numbers, and "PRIME" for numbers cousins #include <stdio.h> main() {...
asked by 11.03.2017 / 23:51
1
answer

Error: incompatible types when assigning to type 'char [200]' from type 'char'

When I try to insert char motorista , an error appears:    [Error] Incompatible types when assigning to type 'char [200]' from   type 'char' Code: #include <stdio.h> #include <stdlib.h> #include <locale.h> typed...
asked by 03.03.2017 / 15:24
1
answer

Allocating text dynamically, and error in free ()

I'm trying to allocate dynamically, but the error is appearing:    Error in ./name.c; invalid pointer: 0x0000000001c18834 My code: // FUNCAO // char *nome(text[]) { int n3 = 0; int n2 = 0; char *n = NULL;...
asked by 19.06.2017 / 22:00
2
answers

How to check if a string is contained in another in C?

I have two variables: char s1[20]; char s2[20]; I will get the input of the user of the two variables, and after that, I need to check if s1 is contained in s2 , even a single part of it. For this I will use a function called...
asked by 19.06.2017 / 19:49