UNIX/Linux Programming - April 2012 (Page 2)

Doing successive read(2)/write(2) operations
 
Hello everyone, In the event where two read and/or write calls are performed close together, how can I prevent the second call from simply returning what was...
[no replies]
Separate GUI and Console applications. How to program?
 
Hello everybody :-) I see here are many C++ programmers. And I have a question... Maybe you know a good tutorial(or something like it) about how it will be go...
[2 replies] Last: Put the functions that do the actual work in a shared library. Both yo... (by Athar)
Shell batch test
 
hi, how to use shell script to test my executable ? if i have two executable here ,like test1 test2,how to do ? need help. thanks
[9 replies] Last: any program's execution updates $? no matter the program is built-in ... (by lukecian)
Using accept(2) method in Linux
 
Hi everyone, I'm attempting to create a client-server application. However, an exception keeps being thrown whenever accept() is called. Here's the code segmen...
[4 replies] Last: Understood. NP (by NewProgrammer)
Small curses program not displaying
 
Please tell me what I have done wrong in the following code extract. while(1) { j = 0; while((i = wgetch(xwin)) != EOF) ...
[2 replies] Last: It is not EOF and until it is EOF, in my opinion, each character shoul... (by straygrey)
by broot
daemon question
 
i'm writing a daemon that just kinda sits around and waits to handle various signals. what's the typical way to keep this kind of program running? is it ok...
[1 reply] : That's an evil loop. NEVER do it like that abstractly!! it occupies yo... (by TheDestroyer)
Segfault when accessing private variable in header file?
 
Hey all this is my first post! Recently just finished a program but I am getting a segmentation fault when I try to call a switch statement with a private varia...
[3 replies] Last: Where is the type define for "inode_t"? To set a break point before ... (by b2ee)
How do I stop in the middle of an if statement
 
I'm trying to make a game of chutes and ladders and i want to be able to get out of the big if statement. How do i do it? #include<iostream> #include<s...
[13 replies] Last: "goto" enough. There is always one reason for the existing of everyth... (by b2ee)
by pk1985
32 bit and 64 bit usage of stat, open, read and write system calls
 
Hi All I am newbie to Linux. I need use stat to get the file size as 64bit(off64_t) on both 32 bit and 64 bit platform. Is it a good practice to set th...
[1 reply] : features.h has: /* These are defined by the user (or the compiler) ... (by kbw)
Segmentation fault (core dumped)
 
Okay well I'm not to advanced at C++, its only my 2 quarter in college taking Computer Science so please don't say anything that will go straight over my head h...
[15 replies] Last: Me being still a noob at this i got a bit lost in the vocab haha. (by Brian Justice)
Give output to child process
 
I'm trying to build a basic shell for Unix. This is the code I use to create a new process: pid = fork(); if (pid == 0) { setpgrp(); complexCommand(...
[1 reply] : setpgrp(); ¿what is this for? [quote=man] If setpgrp() creates a n... (by ne555)
template ,dynamic 2d array, memory leak
 
I have a class that use these template to create and delete dynamic array and return 2d array pointer to caller.I used valgrind to check memory leak it point t...
[2 replies] Last: I don't see anything wrong, that's a "AllocateDynamicArray" function. ... (by S G H)
output unsigned 64bit value using ofstream
 
hi I use fc15 32-bit gcc-4.6.0 and use ofstream to write to my file but some times (I think when the number is too big) it write the unsigned 64-bit value as...
[3 replies] Last: Try using unsigned long long or std::uint64_t from <cstdint> .... (by Peter87)
Basic C/C++ OS
 
Hi, OK. I've decided now. I am going to make a simple, simple, simple text-based OS that can be installed to a 4 GB USB stick. Being Text-based, 4 GB shoul...
[14 replies] Last: reinvent a wheel is time consuming job, why not try LFS (LINUX from s... (by lukecian)
why I got error in private inheritance when use virtual function
 
please shed a light ,thanks in advance #include<iostream> using namespace std; class Sea { public: virtual void get(); virtual void print()...
[3 replies] Last: thanks (by keepinmind)
First time using g++...
 
I got a program which compiles fine in MSVC++, but on g++ it generates hundreds of errors. They mostly look like this: player.h:149: error: base operand of ...
[12 replies] Last: Yeah looking back at my code tests the derived error I got was when I ... (by BHX)
Using execv
 
I use an std::vector<string> as a container for my command and arguments. And I need to manipulate it somehow in order to use execv. My problem is that execv r...
[11 replies] Last: It is still wrong. vector<char*> arg_v; Change this to: vector<con... (by LB)
mutex and condition variable
 
Hi, 1 I think mutex is enough, why we need condition variable? I know I am something wrong here, please correct me. 2 pthread_mutex_lock(). "The ...
[3 replies] Last: They're different things. You lock/unlock a mutex. You wait/signal a... (by kbw)
Good IDE for C++ (1,2)
 
Hi, I'm doing my reaserch regarding IDE's that can be used for writing and debugging C++ code. I personally use QT Creator IDE on Mac OS X as it's quick and...
[30 replies] Last: my arrogance won't drive me to the idea of saying that a programmin... (by rapidcoder)
by youler
unix executable file
 
I am using Mac OSX. I've written and debugged a program, and compiled with g++ from the command line using $ g++ tictac.cpp -o tictac; ./tictac This give...
[no replies]
April 2012 Pages: 123
  Archived months: [mar2012] [may2012]

This is an archived page. To post a new message, go to the current page.