Skip to content

Tag: c++

Maikefile error make: *** [prepare] Error 127

I get the following error form the Makefile: Error: What am I doing wrong? Answer your subshell command git describe –abbrev=0 –tags is executed an returns the string “v1.1.2”. Make then tries to execute it as a program. should work

An implicit try {} catch around main

In each of my main functions, I would like to catch certain classes of exceptions and convert them to exit codes. Is there a more elegant solution to this than starting and ending each main function with macros that will paste the implicit try {} catch I want? Can I somehow achieve this with the std::set_term…

C++, addresses in array [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I have some sort of funny question about addresses in C++. I have such code: This code works…

Prevent output of carriage return with readline

I’m new to the Gnu Readline library. I need to call the readline() function when the cursor is at the very last line of the console. But I need to prevent scrolling down when the Return key is pressed; so I’m looking for a way to prevent the output of the carriage return : I’m sure it’…

linux read sys call doesnt get EOF

First of all sorry if my English won’t be fluent and clear. I’m working on understanding pipes and communication between processes. I have tried to implement two c programs, the one writes into a certain pipe from what he reads from the standard input and the other one waits until the pipe opens a…

bash does not get root permissions with setuid program

I have the following home-grown implementation of su: To allow for proper execution, the permissions and ownership information are set accordingly: When I invoke a shell, such as /bin/sh, I am able to modify root-owned files and directories: However, /bin/bash doesn’t seem to get root permissions: Answe…