Questions tagged as 'c'

1
answer

How to solve the problem of accentuation in the terminal?

I'm writing some strings on the screen using the Opengl library and some of the stored words are accented words, for example: república checa , where the output ends up being: repblica checa can solve this problem without using exte...
asked by 30.04.2016 / 01:03
1
answer

Concatenate string with integer

I have a variable that is a vector of char, and in this vector I need to insert a number that is an integer, fetching it from another variable: int quantidade; char id[3] = 'p'; For example, if the quantity is 2, I need the string id to be...
asked by 29.06.2015 / 01:17
1
answer

Socket TCP in C

I'm having trouble sending a 32k buffer from a client to a server. For example: I have a program A on one machine, which is the client, and a program B on another machine, which is the server. When the client makes the socket connection, and sen...
asked by 30.06.2015 / 16:38
3
answers

Error in pointer return in function

Well, I have the following error: Incompatible types when assigning to type 'char [30]' from type 'char *' The code is as follows: int main() { char *resultado[30]; float valor = 12735.98; resultado=monet(valor); \O AVIS...
asked by 15.05.2015 / 01:38
3
answers

Find day of the week from the first day of January from the date of Easter

I have a college job in which I should build a C calendar from the Easter date of a given year. I can find the date of Easter and build the calendar correctly in ASCII art, but I can not find the day of the week of January 1. This Wikipedia...
asked by 16.05.2015 / 17:30
1
answer

I can not call a string

I've created an algorithm that simulates a stock of a DVD sale. It stores name, price, and quantity. It has some functions and enters them, one that informs the quantity and the price of a specific dvd and it is in that I am having problems....
asked by 14.05.2015 / 20:37
1
answer

Unexpected result in C program

In this code: #include <stdio.h> #include <stdlib.h> int main() { int x, y = 10; //incrementa depois atribui y = ++x; printf("x = %d\n", x); printf("y = %d\n", y); system("pause"); return 0; } Compiled and executed in codeblock...
asked by 11.05.2015 / 13:48
1
answer

Reset pointer address after being incremented several times

I have the following code #include <stdio.h> #define T_INT 5 int main(int argc, char *argv[]) { int v[T_INT],i; int *p = &v; /* Preenchendo o vetor*/ for (i=0;i<T_INT;i++){ v[i] = i; } /* Tentan...
asked by 26.02.2015 / 06:57
1
answer

Read file in binary

Hello, I'm saving a file in binary format and trying to open the same binary. However, I'm not getting the expected result. Here are the writing and reading functions. I am saving a .ppm format image, but when I try to bring it back to ASCII fil...
asked by 12.11.2014 / 01:04
1
answer

Pointer to struct within a struct

I can not assign value to a variable of a pointer of struct within a struct . My structs : typedef struct notas{ float geral; float especifica; }Notas; typedef struct data{ int dia,mes,ano; }Data; typedef st...
asked by 25.11.2014 / 20:14