Skip to content
Advertisement

Tag: c++

Woking With BMP File in C++, Ubuntu

I am trying to work with a bmp file in linux with g++ compiler. I am using C++ language. I Need to load a .bmp file from the standard input. for example: So I need a Code to do this job. I think storing the whole .bmp file is good by I don’t know how to do this. I Tried

setuid(0) fails to execute for root owned program

I need to write some code which can gain root priveleges and execute system level operations. Here’s what I’ve written (this is not the actual code, just to test if I’m doing things correctly or not): After doing gcc -o setuid setuid.c, I run ls -al on this to get following results: Trying to run the application results in: I

Set System date and time using C++ in Linux

I am in the middle of developing a cross platform application that changes the system date and time to a specified value. I have completed the part for Windows. How can I set the system date and time from a C++ program in Linux? I am looking for a function similar to SetSystemTime(SYSTEMTIME &x). As far as I understood settimeofday()

Web Server/Web service written in C++ in Linux

The requirement is to have Linux machine without additional installations aka Java, apache tomcat/jboss, that will be able to serve as a web server and to accept web service request (I will have to write some web service in C++ that will serve under this web server). So, the question is if there is some C++ library that provides such

gtkmm, how to set a tool bar?

I want to have my toolbar at the top of the window, not vertically expanding and I want the entry to expand horizontally. Here a code : main.cc I don’t understand what is the difference between expand and fill, there are two functions, set_hexpand() and set_vexpand() whatever I tried (the last two hours) with these functions I always get the

How to handle 0 Content length in POST request in CGI?

In my CGI application something happens when I pass a 0 content length POST request. Here is my code: I test my application using the Http-Requester plugin for FireFox, when I pass a POST request with no data, the application seems like it enters a loop and no response. If I pass a GET request, the code works fine because

errno after accept in Linux socket programming

As stated in accept() man page in RETURN VALUE section: Error handling Linux accept() (and accept4()) passes already-pending network errors on the new socket as an error code from accept(). This behavior differs from other BSD socket implementations. For reliable operation the application should detect the network errors defined for the protocol after accept() and treat them like EAGAIN by

Linux C++ Detect user shell (csh,bash,etc)

I have a C++ application that needs to make shell specific commands using system calls. Is there a way to detect which shell the user is running? (Csh/Bash/etc). Thanks Elaborate I’m trying to work with some code that forks off via system a rsh call that has a sequence of commands that are using setenv which doesnt work in bash.

Compiling a program with limited library access

i want to compile a C program with gcc and glibc(or any other c library) but i want to limit the program access to certain functions for example program should not be compiled if it uses sockets or signal handling functions. any idea how i could do this?? by the way i want to use this on a simple programming

Advertisement