Skip to content
Advertisement

Tag: c++

Strange Output Difference Between GCC and MinGW (C++)

I’m working on a project for a computer science class. I wrote the code and tested it using MinGW, and it works fine. I then copied the code over to the university’s Linux server and tested it there, since that’s what my professor grades assignments on. The output is very different – like it printed out a carriage return in

Installing PHP in my home directory

I need to install PHP in my home directory, without polluting any directory outside my home [very important requirement!]. In the system there is already an older version of PHP running. I found instructions here: http://blog.thecybershadow.net/2013/01/25/installing-php-and-apache-module-under-home/ I am running these commands in my home directory, as normal user dan The author of the article states that you need to use

How to execute a sudo command with in a C/C++ Program?

I would like to execute one of my sudo commands through one of my C demon. I use the command system(echo MYPASSWORD | sudo -v -S); in my C code. It runs fine when I execute the demon. However, when I exit from the terminal it fails with a return value of 256. Please suggest to me some alternate way

gotoxy() function using printf() ‘s position

Hello there i am working a project which need the gotoxy() function i have read gotoxy() implementation for Linux using printf i wonder why the need to change the x y order in printf, is that just to fit the coordinate system? in my way, i change it to printf(“%c[%d;%df”,0x1B,x,y) to meet my needs stil, during my using this gotoxy()

Does using linux capabilities disable LD_PRELOAD

In my custom environment an interceptor library is preloaded which runs a special implementation of bind(), connect(), etc. calls. The problem I see is whenever an application is explicitly enabled capabilities using command setcap, executing the application fails to preload interceptor library and calls default libc connect(). Is it an expected behavior? If yes, what could be the reason to

gmon.out is not created when executable forks another executable

I am using gprof for profiling. But gmon.out is not created when I fork another executable inside the main executable which is compiled with option -pg. Any idea how to resolve it. Answer But gmon.out is not created when I fork another executable It probably does. It simply has the same name as all the other gmon.out files. They just

Advertisement