I am trying to increase the speed of a tool written in C++.
But, I have difficulties figuring out what pieces of code are taking more time to execute.
Is there a tool that can be of use to me? Something like a "Load Runner".
I am developing on the Unix/Linux platform.
Thanks in advance.
I have about 5 years of programming in C/C++ in Unix environment but am new to programming in the Windows environment.
I have used Motif/GTK for GUI development in UNIX environment.
What is the most commonly used GUI tool/language in the Windows environment??
Is MFC widely used?? How is MFC...
8.6666666... was just an example. It can be any floating point number.
In my case, this number is computed in a for loop.
double tmp, num1;
num1 = chain[j-1];
for (kk = (j-2); kk>=0; kk--)
{
tmp = (1.0 / num1);
num1 = tmp + chain[kk] ;
}
a=num1;
I an doing a computation where in a double value is multiplied with a long long.
For ex:
double a;
long long b;
long long res;
..
..
...
res = a * b;
.....
....
..
res is different on Solaris and Linux platforms
Ex: if a has a value of 8.66666666666666607455 and b = 2370
Linux gives me a...
Hello,
How do I change multiple spaces into a single space on all lines in a file using vi.
I have done this before but dont seem to remember. I open the file using vi, and used to type in something like this
:%s/ \+/ /g
but this dont seem to work.
Please help.
You can use the stringstream class
#include <stringstream>
int i=100;
stringstream ss;
ss << i;
To access the string from the stringstream,
cout << ss.str() << endl;
To acccess a C-string,
cout << ss.str.c_str() << endl;
How do you declare a 3-dimensional array in C++?
For ex:
int abc[100][20][5];
Can it be done through vectors?? or what built in type can I use??
Also, if I have to do dynamic memory allocation, i.e. not hardcoding the array sizes, how do I do it in C++??
The following code gives me a segmentation fault. I thinks its an issue with the syntax of realloc. Please advise.
#include <stdio.h>
#include <stdlib.h>
main()
{
int **arr;
int i,k, j;
arr = (int **) malloc (3);
arr[0] = (int *) malloc (2);
arr[1] = (int *) malloc (2)...
Thanks Salem for the quick reply.
I am in charge of maintaining a piece of software and have the task of increasing the size of these data structures.
My array is
int abc[2048][1024][10];
I want to replace these hardocded values with dynamic allocation.
Initially, during the early stage of...
I have a piece of code that has many variables declared like
abc[1024][1024][10];
Now, i want to increase the size of all these variables to
abc[2048][2048][10];
but, whien i compile and run the program, I am getting a segmentation fault. I believe this is beacuse, it is running out of...
I am trying to start a VNC server on a SunOS 5.5.1 machine, but I am getting the following error.
ld.so.1: Xvnc: fatal relocation error: file Xvnc: symbol stat64: reference symbol not found
Please help.
I have a Sun solaris 2.5.1 Ultra 5 machine.
I want to know if the disk inside if that system is IDE or SCSI type?? Is there acommand to determine this??
Please help.
I am trying to write a csh script to execute the rsync command periodically.
But, I donot know how to capture the standard output and standard error. My ultimate goal is to capture this stdout and stderr and mail it to the user.
How can I accomplish this??
I tried to so something like this
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.