Skip to content
Advertisement

Tag: c++

Using Fork for Command Line Arguements

I’m trying to execute the command “ls -l” but I’m not exactly sure how to approach it. This is what I’ve tried: However, the command doesn’t seem to work here. It works if I just simply use “ls” but I want to use “ls -l” is there another argument I have to pass to get this to work? Answer First

Eclipse 3.8 won’t see gtkmm.h

I’m quite new to C++ and I aspire to learn gtkmm. I’m using linux mint 17.2 and Eclipse 3.8. When I enter:#include <gtkmm.h> the compiler will complain and give this error: I’ve used synaptic and installed libgtkmm-3.0-dev and when I search for the header file locate gtkmm.h I get back the following path: So, now if enter to eclipse #include

How to catch new thread in gdb console mode?

I am running my Qt app from gdb, and i want to stop when new threads creates. (when gdb prints message [New Thread address (LPW number)]. I have set breakpoint b __pthread_create_2_1. That allows me to catch most of new threads prints. but i still got few new threads that are not catched. What else can i do to catch

Unix pipe experiment hangs

The problem is that this program won’t output the expected START and END, also not exiting unless I kill it from shell. Answer You have the order of the dup2( existing_fd, new_fd ) parameters reversed. You have another bug that breaks lots of “let’s try out pipe(2)” experiments. You aren’t closing the ends of the pipe that get duplicated over

`boost::asio` `async_resolve` hangs on Linux, what may be a reason?

I write complex TCP/IP client application that generates a lot of outgoing TCP connections. I try to use boost::asio as portable TCP/IP networking implementation in C++. I found following issue. See the code: This code runs background thread to execute io_service::run method. It is supposed that we’ll have multiple sockets that use this io_service to perform asyncrhonous operations. On Windows

Read noonnamed pipe in terminal

Hellow. I have very simple C program. I create pipe in program (standard, non-named). Can I read pipe of existing process in terminal (stream with > or cat?). I try it but my command do nothing. Im know tkat i can create named pipe who is very easy for external I/O. I have number of pipe for /proc/number/fd Why I

What exactly does Valgrind take in to account when giving the number of allocations? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 7 years ago. Improve this question I’m currently recoding the C/C++ malloc function for Linux usage only.

Looping C compilation and running through BASH

I’m trying to compile and run a C code while looping the input file through bash. Here is my code for the bash script I am using to automate it. So what I’m basically trying to do is compile filewithcode.c so that the executable is stored as compiler1, which takes outputnumber1 and readsfilename1.txt as input. The reason I want to

Advertisement