General C++ Programming - March 2012

Large struct with lots of members and memory corruption
 
I wrote most of a gui using clutter, using tons of global variables. Clutter has a function which you use to connect an event or action like a mouse click to a...
[1 reply] : That error is usually due to trying to reference a pointer with no val... (by GFreak45)
Oh, Interfaces?
 
For a long time I've needed to design certain classes without defining every local variable in the header, and just using functions for all manipulation. I thin...
[3 replies] Last: Oh, that's interesting! I was thinking about something like that. But ... (by Ben Bowen)
by wtf
ok where can I get a java compiler? (1,2)
 
this may seem offtopic but anyway here goes. Where can I get everything I need to run, compile and build a java program? I have tried various 'jdk''s but ...
[28 replies] Last: I think it proves that software developers CAN but choose not to provi... (by wtf)
need help badly pleaseee What is the mod for
 
In logic I assumed it to be the same as in all programming language where all it really does is take the remainder but that doesn't seem to be the case. I wa...
[2 replies] Last: Thanks my discrete professor is not the best I heard he got booted fro... (by wbeasley)
getting hostname or domain name from the ip address
 
Hi , I need a help regarding the socket programming i am doing . I am trying to get the host or domain name from the ip address .. e.g for the ip address 74....
[9 replies] Last: maybe they aren't any aliases - a site does not have to have a set of ... (by guestgulkan)
How good Design a program
 
Hi I am newbie in C programming.Before starting to write a program I want to know more about "How good design a program". May you give me some hints and basic...
[1 reply] : Learn something called "Design Patterns", find a book or 2 about that ... (by TheDestroyer)
vector class
 
High im making a vector class and i need to be able to convert from rectangular components to polar components and back again. The issue im having is that when ...
[6 replies] Last: You just helped me so much you dont even know. This is what happens wh... (by patchesOhulihan)
Memory release while running a secvence of code.
 
I am trying to understand: Is the memory relase proper in this sequence of code? How is the memory released, and through which steps did it go? What those steps...
[no replies]
by Janman
Reading and writing encrypted data to file
 
Hi. I'm writing a program that will encipher a file using XTEA algorithm. I made the algorithm functions to work: void encipher(long *v, long *k) { long v...
[no replies]
Write islower function
 
I have a homework question that asks: Write a C++ function that has an input of a char value and returns true if the character is lower case or false otherwi...
[6 replies] Last: It is simply to write inline bool checkLowerCase (char x) { retur... (by vlad from moscow)
const - are these 2 the same?
 
const char *p = a; // changeable pointer to constant char char const *p = a; // changeable pointer to constant char I'm taking an assessment test. For som...
[3 replies] Last: Here's my version: const char *String; // A char const *Str... (by closed account zb0S216C)
FAR POINTER
 
Why and when do we use far pointer .. i mean .. the situation where the far pointer is a must ? Thanks in advance ..
[2 replies] Last: http://www.cplusplus.com/forum/general/12435/#msg59579 (by kbw)
Reading specific length
 
I've been trying to do this: char* funct(){ char* cont; cont=new char ; cin>>cont; return cont; delete cont; } now I got 3 questions: 1) Where does delet...
[8 replies] Last: thank you too Cubbi, I've decided to go with the aproach Moshchops l... (by tofiffe)
Need to take difference between two dates using time_t
 
I need to take difference between two dates in normal date format like "2012-03-30 17:21:33.027" using time_t..previously i was using unix timestamp so i used d...
[1 reply] : See std::mktime() http://en.cppreference.com/w/cpp/chrono/c/mktime a... (by JLBorges)
by five1
"Error" [Linker error] undefined reference to `point::point(double, double)'
 
hay I am using dev c++ and I am having these errors. [Linker error] undefined reference to `point::point(double, double)' [Linker error] undefined refere...
[13 replies] Last: I am sorry it was just a start of me of classes. But now that's ok I g... (by five1)
by five1
Error invalid conversion from `char' to `const char*'
 
I have this following code and Error invalid conversion from 'char' to 'const char*' occurs. I have created a header file and the other one is the main file(so...
[2 replies] Last: I got it it's working now. Thanks all. Thank you again. (by five1)
Passing shared_ptr by reference
 
I was suggested to replace in few places passing const shared_ptr by value to passing by reference (e.g. change const std::shared_ptr<T> param to const std::sha...
[7 replies] Last: Thinking more about the problem I would agree with Herb. I can't think... (by Fahrenheit2539)
IDE portable?
 
So im using Code::Block and was wondering if it was possible put it on a flash drive and make it porta ble??? Any thoughts???
[3 replies] Last: The cpp reference from cppreference is bundled into the help documents... (by vin)
Infinite Loop (1,2)
 
I cannot pinpoint why the infinite loop occurs. What I have makes sense in my head but not to the compiler sum = 0 incr = 1/num for (val = 20.0; val <= 21.0;...
[23 replies] Last: You should always initialize your variables. Some formatting would be... (by frema)
reallocation is giving an exception.
 
Hello , I am doing a program for dynamic memory allocation.Here we present the user to store three student marks and if the user wants to enter more marks we...
[7 replies] Last: Thanks it works. vlad. (by srikanth chitturi)
March 2012 Pages: 123... 49
  Archived months: [feb2012] [apr2012]

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