UNIX/Linux Programming - January 2009

Scope of pointers after fork()
 
So I am having trouble figuring out which of the following is true for my program: 1. After executing fork() any pointers will point to separate memory locat...
[2 replies] Last: Alright. Thanks. Jared (by jwoolsto)
ofstream is not writing!!
 
Guys, i'm having trouble with my code... I just can't find any mistake, and this is freaking me out! It should open a file used as a Database, to write data in ...
[10 replies] Last: i m a noob in coding(see my post size).well i jus wanna ask wat this c... (by GameOn)
Implement operator= overloading outside class
 
Hi all, I'm having a hard time trying to code c++ into split files. Following is my header file. template <class T> class Matrix { int w, h; T* ...
[8 replies] Last: Ok, I've edited the x.hpp and x.cpp by adding CREATE_INSTANCE for MSVC... (by kbw)
Cygwin
 
I have installed Cygwin along with mingw (for windows). Now when I #include <tchar.h>, what ever function from tchar.h I use, gcc generates an error: first defi...
[2 replies] Last: Actually, it is. Cygwin doesn't include Windows headers. MuneebShakoo... (by helios)
by sergxm
pthread_mutex_lock/unlock on SMP Linux and CPU cache
 
I'm trying to find out how CPU cache coherence is handled by pthread mutex implementation on SMP kernels with multiple CPUs, specifically on core2 chips. For ex...
[1 reply] : This is prob best asked to the developers of pthread, or your operatin... (by Zaita)
code for the card symbols
 
I am writing a code and have tried copying and pasting the actual hear symbol from the net, tried the (char)3 code but nothing has worked does anyone know the c...
[2 replies] Last: Actually, I believe char(3) = end of text character...so it might be d... (by firedraco)
How to remove unused include statements from .c and .h files
 
I'm trying to find a way to automate the removal of unused include statements in header files (.h files) as well as .c files from multiple directories. Is ther...
[1 reply] : Gimpel Lint does that sort of thing. You could check out the free C L... (by kbw)
Serial Communication Problem
 
Hi all I'm trying to have my Linux PC communicate with an ARM development board. The PC will send a request string to the ARM board which will respond with a...
[3 replies] Last: Check this page : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=435... (by maxchirag)
by Poyntz
Sending emails in C++ & logical error
 
1st: Logical Error: cout << "Subscribes? " << endl; getline (cin, subscribes); cout << "Unsubscribes?" << endl; getline (cin, unsubscribes); For some...
[16 replies] Last: Hello poyntz, it seems you haven't read out my notes completely , ... (by maxchirag)
Problem with POSIX Threads
 
Hello! Can anyone say how to use pthread_join because it's a mistery for me. pthread_t threads ; for (int i = 0; i < subGAmount; i++) { pthread_crea...
[2 replies] Last: That is very strange. If the code compiles fine but you get a link er... (by jsmith)
Mysterious Delay
 
Hi, I have a database/socket program that tends to sit & wait too much. Most of the time, if I send one line over the socket connection, it will handle it, a...
[3 replies] Last: Ok, I found my own answer... :) I had to change it to: struc... (by yungblood)
Problem with makefile
 
compile: CliqueGenetic.exe CliqueGenetic.exe : CliqueGenetic.o SubGraph.o CliqueGenetic.o : CliqueGenetic.cpp SubGraph.h SubGraph.o : SubGrap...
[2 replies] Last: Thanks! (by tom1410)
by helios
Getting the CPU count
 
I managed to put this together, but I really don't like it. Is there possibly a more straightforward way to do this? ushort getCPUcount(){ std::ifstrea...
[6 replies] Last: For the record: http://forums.macosxhints.com/showthread.php?p=5128... (by jwoolsto)
i need a function that initializes a 10 by 10 array
 
i need a function that initializes a 10 by 10 array and also prints a board with 10 rows 10 columns. please somebody help me
[14 replies] Last: // initialize all elements to zero int array1 = {}; // initia... (by seymore15074)
Fork and cout
 
When using fork, do both the father and child process print to the same console when using cout? It was my impression that they did, but my program doesnt seem ...
[2 replies] Last: Yea, as it turns out I was being stupid. It all works fine now. (by jwoolsto)
Write to stdin and read from stdout
 
Hello, I was wondering how I could write something to stdin and read from stdout or stderr. I understand that stdin is normally for incoming data (from the k...
[1 reply] : http://www.cplusplus.com/forum/unices/2182/ (by Zaita)
Launching a new process with data
 
So I have this iterative program which needs to perform the same calculations for a large number of different possibilities. Obviously I would like to take adva...
[6 replies] Last: Yes it will, but IPC is more difficult to write than thread-communicat... (by Zaita)
cout<< number for example 00222
 
Plz can somebody tell how to cout<< number for example this 00222, if i want to see 00 too not only 222?
[2 replies] Last: Tnx man :) (by etrusks)
Program crash on pointer to array of pointers
 
I am working on an engineering program that analyzes potentially billions of different designs to determine the best configuration and am having some trouble wi...
[5 replies] Last: I think your confusing multi-threading and multi-processing. Multi-... (by Zaita)
Got not get a correct value from std::string compare
 
Hi, I could not understand following problem, please enlighten me: I am running a program in FC9 (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC)), it ...
[1 reply] : Mayer, Could you post youre code? I wrote this with the following o... (by jwoolsto)
January 2009 Pages: 12
  Archived months: [dec2008] [feb2009]

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