Questions tagged as 'c'

2
answers

How to create a vector of variable size?

In C language, is it possible to create a vector, of any type, so that its size is variable? If possible, how?     
asked by 26.09.2014 / 21:03
1
answer

Security - Syscall inside shellcode does not execute

I'm studying information security and experimenting with trying to exploit a classic case of buffer overflow. I've succeeded in creating the shellcode , in its injection into the code and in its execution, the problem is that a syscall for...
asked by 24.07.2015 / 22:58
4
answers

Simple Pointer Teaching

I'm a sporadic programmer, and whenever I need to use pointers, I realize that I've forgotten how to use it, and I have to grate to learn everything again. Does anyone have any simple didactics to remember the concept of pointers, and that is...
asked by 25.07.2014 / 20:12
4
answers

Is it possible to develop websites with C / C ++?

I know a bit of PHP, but I see that on content sites, sometimes it fires and so on. Researching, I have seen (very shallow) reports that it is possible to develop web applications with C / C ++, and that these, in turn, would have far more pe...
asked by 15.12.2016 / 10:15
5
answers

Test if all characters in the first string also appear in the second

I'm trying to do this function with the help of the functions strcmp() and strncmp() and I'm not having great success. Let's say that I have the string char s[] = "abc" and another string char v[] = "cdeabf" , the...
asked by 14.03.2015 / 13:36
4
answers

Output a C code with pointers

I need to understand what each of the values printed on the screen means by the following code: #include<stdio.h> int main() { int i=5; int *p; p = &i; printf("%u %d %d %d %d \n", p, *p+2,**&p,3**p,**&p+4); return 0; }...
asked by 20.10.2017 / 12:27
2
answers

Fork in Windows

There is something in Windows like (or some similar alternative to) fork POSIX systems (UNIX and Mac) to create a child process that is an exact copy of the parent and runs from the calling point? As far as I know CreateProcess...
asked by 05.03.2016 / 00:58
1
answer

Compiling on your computer actually improves performance?

Any programmer knows that when compiling a C / C ++, the compiler can optimize code to generate faster executables. But, it's also said there is compiler optimization for your processor. This means that if I created a C program and compiled i...
asked by 17.05.2014 / 10:01
1
answer

Discrepancy execution times in parallel programming

I made a parallel code in C to verify its execution time. It was treated: Threads; Mutex; False Sharing; Synchronization. When running time of Linux with code execution, it was generally possible to compute at the following t...
asked by 22.02.2014 / 15:16
2
answers

What is the difference between * var ++ and * var + = 1?

I am writing a function with the signature: int increment(int *val) . My intention is to get an integer pointer, increment its value in 1 and return that value. The body of my function was as follows: int increment(int *val) { *...
asked by 22.11.2015 / 18:35