Questions tagged as 'c'

2
answers

Why do not you need the '&' in 'scanf ();'?

I learned that the variable always has to have & , but in this example it does not need to and still shows the result. Why did not you need & no scanf(); ? #include <stdio.h> int main(void) { int int1, int...
asked by 12.08.2018 / 23:52
2
answers

Access to specific memory points

How do I access an exact memory address in Windows? unsigned char * mem = {??};     
asked by 22.07.2015 / 01:16
2
answers

Bogosort - what is this?

What exactly does the bogosort sorting algorithm do? Why do many people say that it is inefficient?     
asked by 26.06.2016 / 16:05
1
answer

If it is executed even with the condition being false

I have an excerpt of a function with the following code: printf("caminho: %d\n", t); printf("min: %d\n", min); if( min >= t && t != -1); { printf("oi\n"); min = t; printf("min: %d\n",min); } and as a result I have:...
asked by 04.04.2016 / 21:07
3
answers

How do I get the directional keys in C / C ++?

Is it possible to pick up the directional keys (famous little keys) from the keyboard? if so how?     
asked by 19.03.2014 / 13:07
2
answers

How to separate a string into pieces?

In other languages there is split , explode or something similar that chucks string into chunks according to some separator. Is there something C ready or do I have to do on hand?     
asked by 17.03.2017 / 12:20
4
answers

Converting float to char array in C / C ++

Recently I ran a test and there was an issue that asked for a number like 123.456 to be displayed as 321.456 . I thought the best solution would be to convert this to an array of char and then create an algorithm to print pos...
asked by 03.04.2014 / 18:42
1
answer

What is the difference between puts () and fputs ()?

I know that both functions are for displaying strings on the screen. But what is the difference between them? Which one is best to use?     
asked by 12.09.2014 / 18:14
3
answers

Passing vector to functions

How do I pass a vector to a function? Something that, in the Moon, would be like this: vector = {"V", "e", "t", "o", "r"} function getVector(vector, pos) return vector[pos] end print(getVector(vector, 1)) Output: "V" I tried this way:...
asked by 16.12.2014 / 00:35
2
answers

Problems with sizeof

I am trying to return the size of the array , but it is giving error. What to do? #include <stdio.h> char *palavra[] = {"casa", "carro"}; int main(){ int i; for(i = 0;i < sizeof(palavra);i++){ //Segmentation fault aqui....
asked by 19.01.2017 / 16:02