hi
how to start learning multithreading. Is multithreading related to OS in which program is running.
thanks in advance
User Profile
Collapse
-
thank u for u r replys
if a variable is newed twice then will the memory be allocated twice.
Code:#include <iostream.h> int main() { int *i; i = new int; //newed first time cout<<&*i<<" "; i = new int; //newed second time cout<<&*i; }
in the above code the variable i is newed... -
hi geek biz
in u r code u r decrementing the x value which is always less than c and hence it falls in to infinite loop.
try this
[code=c]
#include<stdio. h>
main()
{
int x, y, c=5;
for (x=c; x>0; x--)
{
for (y=c; y>1; y--) //changed this line
printf("*"); // changed this line
printf("*\n"); // changed...Leave a comment:
-
scope of dynamic variabe after program termination
hi
a variable is allocated in dynamic memory(using new and is not deleted) and the programs gets terminated .now does the memory allocated will become junk.
Code:int main() { int *i = new int; }
does this allocated memory will never be free even after program termination. -
thank u much for u r replys.
i wanted to create the objects of a class whose names should be the attribute name which are present in the xml file.
this is because as the attributes in the xml files gets increased the code should not be modified.
thanks for the examples provided.Leave a comment:
-
thanks for reply
there are two classes CLASSA and CLASSB.
object of CLASSA is OBJA.
object of CLASSB is OBJB.
now
CLASSA contains function FA()(return type of FA()is string) which returns(OBJA.FA ()) the name of object(ie.strin g, not the object itself)
how to convert this string to object.Leave a comment:
-
object to string
hi
i have a function which returns object.
how to get the name of the object . -
what happens when newed more than once
hi
if we new more than once the same object does it allocates memory multiple times. -
does pointing to 0(NULL) will not point to data in 0th locationLeave a comment:
-
-
object initialized to zero(not a pure virtual function)
hi
i saw a program which inside its class initializes another class object to zero.
also if i initialize to some other number other than zero ,an error occurs.
Code:Circle* cp = 0;
can some one could explain what it is. -
-
strange class declaration
hi
i came across this following code could some one explain whats happening with the int refCount(ie.how can an argument be passed to an int) in constructor.
Code:class SharedImage { public: SharedImage() : refCount(0){}; int refCount; };
-
difference between static and global variable
hi
what is the difference between static and global variable -
how to get individual bytes of an int
hi
i have an int (which is of four bytes). i have to fetch the individual bytes of an int(ie. storing it as 4 character) .
how to get the individual bytes of an int
bye :) -
i have not posted the entire program .
thanks for reply
i have found the error.
while newing the class i have allocated like this
data = new xml_data;
data->pVsipl_buffe r = new int(LOOP*COL);
instead of square brace( [LOOP*COL] ) i have used curly brace((LOOP*COL)) .
but it had compiled well but caused runtime error...Leave a comment:
-
thanks
ie. a function returning the object of type class_name. right.Leave a comment:
-
new , strucure and PROGRAM CRASH
hi
i have a structure xml_data
struct xml_data
{
int prf;
int *pVsipl_buffer;
};
i have declared and allocated memory like this in constructor
data = new xml_data;
data->pVsipl_buffe r = new int[LOOP*COL]//LOOP and COL are
//#define(d) constants;
xml_data... -
accessing protected member functions in c++
hi
is there any way to access protected member functions which is inherited in c++.
thanks in advance -
object as function
hi,i came across a program where one line goes like this
SQ_Config::inst ance()->readBoolEntry( "mount_devi ce", false)
here i found that SQ_Config is a class but there is no function called
instance().i had ran the program and it works fine.
please clarify thanks in advance.
No activity results to display
Show More
Leave a comment: