- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
33 Posted Topics
Hello, Please help me to overcome the following confussion. Suppose I have created an array of pointers like, A** l_aAPtr = new A*[l_iTotal]; for(int i = 0; i<l_iTotal;i++) { l_aAPtr[i] = new A(); } Now I want to delete this array. Please advise which of the following way is correct … | |
Re: "`num1obj`" is just a pointer of type "`objNumber`". A pointer is a special type of variable which can hold the address of an object. So by writing the line "`objNumber* num1obj;`", you have created a pointer variable in heap which can hold the address of an object of type "`objNumber`". … | |
Hi friends, In Windows if we create an exe with MSVC6.0 a corresponding ".lib" file is generated. This file can be used for accessing (linking) the classes defined within that exe from some outside libraries (dll). Now in unix platform (ie, Red Hat Linux), how can we use that technique. … | |
Hello, Is there any utility which can generate sequence diagram from existing C++ source code? Thanx in advanced. Amitendra Mukherjee | |
Hello, I was trying to make a client-server application using java orb. Server was fetching data from database and passing them to client. The client was getting an exception for large numbers of rows (say, 50K). Jan 15, 2013 11:48:51 AM com.sun.corba.se.impl.transport.SocketOrChannelConnecti onImpl readFully WARNING: "IOP00410215: (COMM_FAILURE) Read of full … | |
Hello friends, I am evaluating Database connectivity from C++. I have found OTL(Oracle, Odbc and DB2-CLI Template Library ) from googling, which seems good for that purpose. Can you please provide me some inputs / feedback about OTL (or other suitable DB handling libraries). Also please inform, from where I … | |
Hello, Can you please suggest me some 3rd party C++ libraries like RogueWave SourcePro C++. Thanks in advance, Amit M. | |
Hello Friends, I am trying to porting an unix c++ program into windows using MSVC8.0 compiler. In my unix version there are some lines like [CODE] #include <sys/atomic.h> ... atomic_add_int_nv() ... [/CODE] Now, pls help me to find out the Win version of these code segments. Thanks, Amit | |
Hello friends, Suppose I want to write a dll file with MS-VC8.0 compiler. I need to add [B]__declspec(dllexport)[/B] for all of the functions which will be called from outside of that dll. Now my question is that whether it is possible to export all functions of that dll at a … | |
Hello Friends, I am trying to porting some pre-existing code to VC++ 2005 in Win XP environment. I have a segment of code like, [code] ... #include<fcntl.h> #include <sys/types.h> #include <sys/stat.h> ... ... cm_iFile = open(l_chBuff,O_RDONLY|O_BINARY); ... [/code] During compiling this file I am getting the following error message, [B]..\source\CRaterEDRFile.cpp(276) … | |
Hello friends, I am facing a linking problem in VC++8.0 compiler. Suppose I have a library, say A.dll. In this library I have a file, say x.cpp. Within this file there is a extern const variable, like [code] ..... __declspec( dllexport ) extern const long ERROR = 100; ..... [/code] … | |
Hello Friendz, Suppose I have a program like [code] // A.cpp int main() { if(some_condition) return 1; return 0; } [/code] Now from another program I want to run the above program, like [code] //B.cpp int main() { ... ... system("A"); ... ... return 0; } [/code] Here how can … | |
Hi, Suppose I have a char*, which holds a string value. Now I want to print the address of that char*, not the string value. Pls help me in this problem. Amit | |
Hello friends, Is there any problem with "Zero-Length-String" in C/C++. Pls mention if there is any type of problem in standard string library-functions like strcpy, strcat, memcpy, etc. Thanx, Amit | |
Hello friends, Suppose I have a .doc file (MSWord). Now, how can I read that file using C++ console application, ie, not using MFC or any other visual components. Thanks, Amit | |
Hi What are the basic differences between the methods atol() and strtol()? Regards, Amit | |
Re: try this [code] ..... ..... int main() { double scores[50]; double avg ; string names[50]; int count=0; ifstream data; data.open("in.txt"); while (!data.eof()&&count<=50) { data>> names[count] >> scores[count] ; count++; } [B][COLOR="Green"]double sum=scores[0],max = scores[0];[/COLOR][/B] for (int m=1; m<count; m++) { sum+= scores[m]; if (scores[m]>max) { max= scores[m]; } } .... … | |
| |
Hi friends, How can I get the time stamp of a file from C++ program. Amit | |
Hi friends, Can you pls tell me about "[B]explicit template instantiation[/B]". Suppose I have a simple program : 1. File : TClass.h [code] #ifndef CTCLASS_H #define CTCLASS_H template<class T> class CTClass { public: CTClass(T t1, T t2); ~CTClass(); T add(); private: T cm_T1; T cm_T2; }; template<class T> CTClass<T>::CTClass(T t1,T … | |
Hi Friends, Can any of you pls tell me (in detail) which of the following options will be faster? Option 1: [code] int fun() { if( !cm_aObject ) return -1; return cm_aObject->getNum(); } [/code] Option 2: [code] int fun() { try{ return cm_aObject->getNum(); }catch(...){ return -1; } } [/code] Thanx, … | |
Hello Friends, Suppose I have a function like - [code] void myFunc( char* str) { ....... ....... } [/code] And I have to pass a pointer of type "const char*" into that function. Now my question is that can I pass the pointer like following way (ie by custing it … | |
Hello friends, I'm trying to write a program to check the status of a process (specified by its process-id), ie, the process is presently running or not. Can you pls give me some idea to solve it? Thanks in advance. Amit | |
Re: U can open these picture file in binary mode and compare each charecter... [code] #include <iostream.h> #include <fstream.h> int main(void) { char fileName1[50], fileName2[50]; cout << "Enter files :\n"; cin >> fileName1 >> fileName2; fstream filePtr1, filePtr2; filePtr1.open(fileName1,ios::in | ios::binary); filePtr2.open(fileName2,ios::in | ios::binary); filePtr1.seekg(0,ios::end); filePtr2.seekg(0,ios::end); if(filePtr1.tellg() != filePtr1.tellg()) { cout … | |
Re: remove %c from scanf... [code] //scanf("%49[^\n][COLOR=Red][B]%c[/B][/COLOR]", &sentence); scanf("%49[^\n]", &sentence); [/code] | |
Re: Hi drock9975, Try this... :cool: [code] #include <iostream.h> #include <string.h> struct Weapon { char* type; int ammo; }; int main(void) { int* total = new int; cout << "How many weapons do you wish to catalog? "; cin >> *total; Weapon* catalog = new Weapon[*total]; for (int i = 0; … | |
Re: Hi Varun, Just try this: [code] Rectangle *ptr_arr[2]; ptr_arr[0] = new Rectangle(10,20); ptr_arr[1] = new Rectangle(15,5); [/code] | |
Hi All, I am facing a problem with new line character (\n). When I am initializing a string variable with a string having a new line character, e.g., [code] char str[20] = “Programming is \nfun | |
Re: Hi Greenthumb, You can try this: [code] pStream = new FileStream(strSavePath, FileMode::Open); pReader = new StreamReader(pStream); count = 0; int array[100]; for(;;) { strLine = pReader->ReadLine(); Console::WriteLine(strLine); if(strLine == 0) break; array[++count] = atoi(strLine); } [/code] | |
Re: I think you should comment out the first line. [code] [B]//#include"myheader.h"[/B] #include<iostream.h> #include<time.h> #include<stdlib.h> #include<windows.h> ... [/code] | |
Re: Hi rkarimi, You should use reference variable to solve this problem. [code] typedef float MYFLOAT; // or Called Standalone #define MYPRINT printf #define MYMAIN main #include <string> #include <cstdio> #include <cctype> #include <stdio.h> #include <stdlib.h> void MAKE(MYFLOAT*[COLOR=Blue][B]&[/B][/COLOR] R) { MYFLOAT RI[]={-1,4,3.34,4.78,5.23}; R=new MYFLOAT [5]; for(int i=0;i<5;i++) R[ i ]=RI[ i … | |
Hi all, Can any one tell me how to delete any file from a C++ code. I can do it with the help of the function 'system()', but is there any other way? :?: :?: :?: |
The End.