Questions tagged as 'c'

3
answers

Why not use if within a cycle for

Hello, my question is this: for (int i = 2; i < n; i++) if (n % i == 0) return false; return true; Given an example like anybody like this where I have a if within a cycle for , the teacher told me:...
asked by 24.01.2018 / 04:19
2
answers

How to delete a keyword from a text in C?

I have an exercise that says: Encode a program that reads through a keyboard a keyword of up to 15 characters and a text of up to n lines (n being a constant value). The program should eliminate from the text those lines that contain the ke...
asked by 03.01.2017 / 11:58
1
answer

Read file and write .txt files in C language

The following is to see what is my failure to write a code because I know that there is interaction (reading) between the program and the .odt file, which is the case that I tried, but I bring the text in strange symbols and not in letters. In...
asked by 19.04.2017 / 17:00
2
answers

noo I can declare the global variable

if I want to declare these global variables int D1=2; int D2 = D1-2; int main(int argc,char* argv[]) { } because the compiler sent me here int D2 = D1-2; ? says initializer const is not constant     
asked by 12.02.2017 / 03:33
2
answers

c / c ++ - Use sizeof in a file

I'm trying to answer the question:    If you have a file declared "FILE * f;" the sizeof (f) function returns the size of the file. When loading data to the file I notice that the size is not updated therefore I conclude that it is False....
asked by 23.10.2017 / 17:32
1
answer

Arrangement of procedures c

I need to create an arrangement of procedures in c , I did it in this way but I get an error: typedef void TFunc; int main{ TFunc funciones[25] = {definicion de mis funciones}; }     
asked by 22.03.2018 / 17:27
1
answer

Error in program: undeclared here (not in a function)

I am trying to run this program in C but it generates an error. Does anyone know what I'm doing wrong? #include<stdio.h> #include<stdlib.h> #include<math.h> #define N 1 int vector[N]; int vector_frecuencias[N][2]; int num_di...
asked by 07.05.2018 / 13:28
1
answer

for loop initial declarations are only allowed in c99 or c11 mode

How do I resolve the following error?    [Error] 'for' loop initial declarations are only allowed in C99 or C11 mode (I use the C compiler: Dev ++ ).     
asked by 27.05.2017 / 21:45
1
answer

'' Solitaire game '' simple mode, with lists in C language

It's more than I'll be in case you can give me advice on how to implement it. I'm starting on this topic of data structures. The statement says the following:    The board will consist of six columns with cards and a space to indicate w...
asked by 26.08.2016 / 03:53
1
answer

Incomplete types and opaque pointers

I have seen articles in English that talk about this, as I have understood they are used for encapsulation in C. Can someone explain that it is exactly an incomplete type and an opaque pointer? And what uses do they have in C?     
asked by 26.04.2017 / 20:07