Questions tagged as 'c'

3
answers

Size of a String

A char in the C language takes up 1 byte in memory.Ex: char ch;//a variável ch esta ocupando 1 byte na memória And a vector of char better known as string , its size in bytes will be counted according to the vector numbe...
asked by 30.09.2016 / 16:21
2
answers

Undefined function reference

I have a problem related to the modularization of my project. Do not get too much into the logic of the program, because the biggest problem I face is the fact that the program does not compile. I think the problem lies in linking between the...
asked by 09.01.2015 / 02:23
4
answers

Memory allocation for pointers

I've been reading and studying pointers and I came across the following quote in a book: "Although it is possible to use them as vectors, pointers do not have their own memory. Pointing can only be used after a pointer is pointing to some obje...
asked by 17.08.2015 / 12:37
2
answers

Data Structure - Double C-Linked List

I am doing an activity proposed by a teacher, which asks you to remove an element from the end of a double chained list. But the function I put together to solve the problem is locking the program. In the resolution I thought that if it were mad...
asked by 13.01.2015 / 13:01
2
answers

Methods without parameters and with parameters

Declaration methods without parameters: void exemploDeMetodo(){ int i; } Calling methods without parameters: exemploDeMetodo(); If I want to do a parameterized method it's like? Is it like this? void exemplo(int i){ faz al...
asked by 02.11.2014 / 18:18
4
answers

Problem to find prime numbers

Today in college I learned about for and while . However, the code I am trying to formulate does not spin. It compiles but "buga" after it puts the value. The code is simply for verification whether the number is prime or not. #in...
asked by 24.03.2014 / 21:53
2
answers

How do I exit a loop by entering a specific value?

I need to make a program that multiplies the numbers entered by the user, and when it says 0 (zero), the program shows the multiplication of the numbers entered. However, I am in doubt as to how I will do this without clearing my multiplication....
asked by 17.10.2015 / 21:36
3
answers

Rotate matrix in 90º

I need to create an algorithm in C to rotate a 10x10 matrix by 90 degrees, though I can not use an auxiliary array for that. Simplifying what was asked to try to find some pattern and use it to solve the problem I used a 3x3 array and compare...
asked by 24.08.2015 / 15:53
2
answers

Sizeof () or strlen ()?

sizeof() or strlen()? What's the difference between using them in char pointers? which is more appropriate?     
asked by 29.07.2016 / 20:23
2
answers

Pointer changes address when exiting function

When performing a dynamic allocation of a vector or matrix in C, the pointer referring to this allocation changes address when leaving the function, whereas before it was pointing to the initial address of the allocated area and soon after the e...
asked by 09.11.2016 / 20:17