General C++ Programming - March 2009 (Page 9)

by hamdy
Hilfe bei Vectoren
 
Hallo Leute ich versuche jetzt ein Programm mit c++ zu schreiben welches nach vor und nachmae fragt und danach soll der Benutzer Klausur Noten ,Referat Noten u...
[1 reply] : This is a website in English, not in German and use [ code] tags wh... (by Bazzy)
swap program
 
hello I have to write a swap program for school and im on break now so i have no access to help.. the program has to look somewhat like this #include <iostre...
[4 replies] Last: thanks so much (by coincollector)
by hamdy
Display a number and its ASCII code at the same time
 
Hello ,,, if i have an int variable named i=10 how can i display ...(with cout<<) the variable and its ASCII code ? thanks alot A ,Germany !
[2 replies] Last: cout << i << char( i ); ASCII 10 is the newline character... (by Bazzy)
functional abstraction
 
Has anybody gone through Item 20 of Scott Meyers: 50 Specific Ways? In that item, he tries to give two specific advantages of declaring data members in private ...
[3 replies] Last: On second thought, I now get your point. He says clients cannot direct... (by n4nature)
A Query on pointers
 
Well another query for the day. A bit long post this time. Please bear with me and help me I have a class called TEnt which basically defines a entity. I h...
[3 replies] Last: Hi guys, Thanks for your feed back. I sort of found out the error. I... (by Sundar0206)
Convert int to string with number in different base
 
How would you go about converting an int to a string which represents the same number in a different base? In my case, I have to convert a number to PENTA d...
[7 replies] Last: I think you misunderstand what I was trying to show. The array of cha... (by jdd)
by ark217
Regarding prime numbers
 
I had a test with a question on it regarding prime numbers and was hoping someone can explain to me how I would have solved it. I got it very wrong... Basi...
[4 replies] Last: Okay- thanks for the responses. I understand now. (by ark217)
getline(cin,string obj); problem....
 
Using Linux g++; sample code as follows : #include<iostream> #include<string> using namespace std; int main(){ string str ; int oo; cout...
[2 replies] Last: if i've understood your problem correctly then use endl after cout and... (by writetonsharma)
any suitable engines for dev c++?
 
hey, im fairly new to the c++ universe. i have been working through several tutorials i have found over the net and one thing kept bugging me. as much as i g...
[3 replies] Last: hmmm.. opengl is basically a c library for graphics programming.. infa... (by writetonsharma)
Weird error (1,2)
 
Hi Guys, I am having this weird problem, class myClass { public: string s1; string s2; string s3; string s4; string s5; }; ...
[25 replies] Last: hmmm... lets leave this discussion here and look for other interes... (by writetonsharma)
by xargon
Converting froma char* to a const char*
 
Hello all, Can I safely cast from a char* to a const char* like this: const char * destPtr = reinterpret_cast<const char *>(srcPtr); Is this safe or is...
[4 replies] Last: +1 kbw. Never use C-style casts, period. (by jsmith)
Mutex problem
 
Hi everybody, I have a program mutex problem between two threads (one thread in the main function and the other in a thread function). I have a global mutex ...
[2 replies] Last: I assume the thread has initialized the mutex before the main program ... (by jsmith)
Converting huge numbers to array
 
I'm having problems with a task, which requires from me to find the factorial of a number n, and find the last non-zero digit of that number. You'll probably t...
[2 replies] Last: Ok, now for some helpful advice. Consider how long-hand multiplicat... (by jsmith)
mutex's ownership
 
Hi everybody How can I hand over the ownership of a created mutex in the main function to other thread?
[4 replies] Last: I have to threads: one in the main function, one in a separate functio... (by radeberger)
by sac
fwrite cannot wite data into file if data size is very small
 
What's wrong with my following c code? I cant find the problem, Help me! I am trying to write data into a new file using the fwrite function if data size is sm...
[12 replies] Last: @writetonsharma: Right. fwrite() buffers the short data in an inte... (by jsmith)
by xargon
making a global variable accessible in a DLL function
 
Hello, I have a question about how to make an application global variable be accessible from a DLL. The problem is that some of the classes that this DLL ...
[2 replies] Last: do a __declspec(dllimport) instead of __declspec(dllexport) i think i... (by writetonsharma)
write function: max default buffer size
 
Hi, Does anybody knows what is the max default buffer size in the write function? outfile.write (recvbuf, bytesRecv). I want to ckeck how many times th...
[2 replies] Last: thank you Bazzy. I'll try it... (by radeberger)
ReverseList Iterator
 
Hi all, I am trying to create my own template class reverse list operator. And was wondering how do i reverse the list. I can't seem to use list.reverse() as...
[2 replies] Last: I made some changes by adding a previous Node to my List class. Based ... (by shaoen01)
Template Class
 
I have defined two template classes A and B. A has its two files - A.h and A.cpp B has only one file - B.cpp I am using both of them in main.cpp So, i...
[6 replies] Last: Typically template classes are implemented wholly in header files. Yo... (by jsmith)
Strange Problem
 
I have a template class template<class T> class Atomic { volatile T value; T* getReference() { return &value; } ...
[3 replies] Last: Can you provide example code that demonstrates the problem? (by jsmith)
March 2009 Pages: 1... 7891011... 21
  Archived months: [feb2009] [apr2009]

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