Questions tagged as 'c'

2
answers

How to identify a line break character in C?

Problem: Sometimes I get an entry like (andtheinputcontinues)othertimesas: (andtheinputcontinues)Thatis,Icanreceiveaninteger,ortwo,orthree,andthenlaterreceiveastringtodoanything.Myproblem:Icannotsetwhentostopreceivingtheintegers.Itriedtoiden...
asked by 24.08.2018 / 23:12
2
answers

How to transform my code with struct from static memory to dynamics in C?

The exercise asks me to read information in a file, being they, cpf, name, email and age of several people stored in a struct, sort in ascending order by age, if equal ages by cpf, and print in another file with the same format as it received, a...
asked by 13.09.2018 / 22:38
2
answers

Dynamic vector allocation

The statement follows:    Make a program that reads keyboard numbers and stores them in a   vector dynamically allocated. The user will enter a sequence of   numbers, with no quantity limit. The numbers will be typed one by one   and, in case...
asked by 14.08.2018 / 18:04
1
answer

How to use JSON JavaScript to retrieve result in C?

I realized that JSON is used to communicate between systems. So it is possible to communicate with C, retrieving variables through a JSON generated by the code and send through the JavaScript AJAX response? Or is there a better known techniqu...
asked by 14.08.2015 / 05:18
2
answers

Project C in Visual Studio 2013

I'm learning C in college and I'll have to program in C. In Visual Studio 2013 I can create projects in C ++, but I did not find anything like a "Visual C". Is there any way or extension that allows the creation of pure C projects?     
asked by 29.09.2014 / 02:07
2
answers

Taking system time in C

I want to get the start and end time of a for . Ex.: #include <stdio.h> #include <time.h> int main () { time_t rawtime; struct tm * timeinfo; int i, j; time ( &rawtime ); timeinfo = localtime ( &rawtime );...
asked by 04.11.2014 / 23:42
1
answer

Vector reading in C is wrong

struct cadastro{ int codigo; char nome[200]; char cpf[11]; char rg[10]; char tel[12]; char end[100]; }cadastro;//struct do tipo cadastro. struct cadastro cd[max];//vetor da funcao cadastro de cliente I have set up a menu, with do - while...
asked by 09.05.2016 / 00:08
1
answer

Close console window in C

I need to create the old woman's game. I want to know how to close the black little window that appears without needing to click any key, for example: When you run the program it appears:    1 to play       0 to exit If the user types 0,...
asked by 15.06.2016 / 23:36
2
answers

Code to calculate the first N prime numbers in C?

First, I have this here: #include <stdio.h> #include <stdlib.h> int main(){ int i=13,w=0,k; for(k=i-1;k!=1;k--){ if(i%k==0){w=1; break;} } if(w==0){ printf("\n%d eh primo",i); } sys...
asked by 24.12.2015 / 17:24
1
answer

How to print the variable name in C?

Example: I have an integer variable called menino , how do I print to a printf the name of this variable, ie "menino"     
asked by 12.08.2015 / 00:49