First  |  Prev |  Next  |  Last
Pages: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
writing hex bytes to a binary file
I am trying to write hex bytes to a binary file. I have no problem doing this if I use hard coded values like this; #include <fstream.h> ofstream OutputFileStream ; OutputFileStream.open("binaryfile.bin", ios::binary) ; OutputFileStream << '\xF6' ; OutputFileStream.close() ; But what I really want to do is t... 19 Jan 2008 11:02
range of an int
What is the purpose behind having ranges for various signed integer types as -2^n and (2^n) - 1? I don't follow why the postive end subtracts 1 from the 2^n value to establish the upper limit. Can someone explain the reasoning behind this? -- conrad ... 13 Jan 2008 05:24
is thi the twilight zone
I am just starting to learn c++ but is it normal to be completely bewildered once i get into class functions and constructer copy's and such. Do you really need calculus math ? Or is this normal starting out? ... 13 Jan 2008 22:15
why does the h file is needed?
I was wondering why h file is needed? I heard it is because in h file the compiler discover what memory is needed for allocation. is that true? thank ... 13 Jan 2008 21:42
delete a pointer which has more then one reference in a vector
If two elements in a vector point to same address, how to check second on is NULL? vector<B*> a; B* b = new B; a.push_back(b); a.push_back(b); delete a[0]; if(a[1]==NULL) // how to know it? ... 12 Jan 2008 23:15
queue code
I'm in a chapter on advanced thread synchronization and the author uses a queue structure as follows: typedef struct queue_tag { HANDLE q_guard; // for a mutex HANDLE q_ne; // queue not empty HANDLE q_nf; // queue not full volatile DWORD q_size; // max queue size volatile DWO... 8 Jan 2008 12:14
Linux and C
I done some searching but was hoping to get the "gurus" advice in the group. I'd like to start writing parts of my own code into the linux kernel. (Most likely using the Debian 4.0r2 release). Is standard or ISO C about the same as GCC C or should I stick strictly with GCC standards? Thanks for your replies. ... 8 Jan 2008 00:39
Compiling multiple files
This is probably a really simple question and chances are I am missing something very obvious, but I havn't done any coding since uni 6 years ago! I have a few files: main.cpp sock.h/.cpp client.h/.cpp I have tried compiling them with "g++ -c <insert cpp file>" then sticking them together with "g++ -o runme s... 7 Jan 2008 15:07
delete pointer
struct B{ int e[5]; B(){e[0]=0; e[1]=1; e[2]=2; e[3]=3; e[4]=4;} int& operator[](size_t i){return e[i];} int operator[](size_t i) const {return e[i];} }; int main(){ B* a[2]; for(int i=0; i<2; i++){ B* c = new B; a[i] = c; } for(int i=0; i<2; i++) delete a[i]; cout << (*a[0])[1] << ... 7 Jan 2008 20:44
A Dumb Noob Question. error: expected `;' before 'cout'???
Timmy <Timmy15(a)Spamnot.com> writes: I'm trying to write a little random password generator, <snip> That is the error that g++ is spiting out.. 1.cpp: In function 'int main()': 1.cpp:32: error: expected `;' before 'cout' Ain't any such error, I checked and double checked. No? cout << p... 7 Jan 2008 03:49
First  |  Prev |  Next  |  Last
Pages: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22