It's not unheard of for a compiler to do this even for non-constant variables, if it's convinced that nothing in the code ever touches the var. Things like:
Hi,
I have a while read loop that reads files in a directory and process. The files have spaces in between, so I have the IFS=\n to to read the whole line as one file name.
The read works fine but I have a problem with another variable that I set in the beginning of the script. The variable... (1 Reply)
I have a variable:
$FILENAME = /XXXX/XXXX/XXXX/file.dat
I want to set another variable that will give me this:
$FILENAME2=filea.dat
So basically i'm chopping up variable $FILENAME.
Not sure cut will do this as i'm looking at different directories so the characther length may be... (2 Replies)
Is it permitted to type-cast a member variable passed in as a parameter in a member const method ..
I am doing something like :
in a
return-type method () const {
variable other = long(member variable)
}
this other assigned variable is not updating and I wonder if type-casting in such... (1 Reply)
See code below. It appears that i and j inhabit the same address yet hold different values. Can anyone shed light on this?
int main() {
const int i= 3;
int* j = const_cast<int*>(&i);
*j = 5;
cout << j << endl << &i << endl;
cout << *j << endl << i;
} (4 Replies)
Hi,
Can any one tell me why my following program is crashing?
#include <iostream>
using namespace std;
class CA {
public:
const static int i;
};
const int CA::i = 10;
int main() {
int* pi = const_cast<int*>(&CA::i);
*pi = 9;
cout << CA::i << endl;
} (6 Replies)
Hi All please help if possible. I am a Unix novice. I have a similar question to the one posted by yonderboy at about a year ago. However his solution does not work for me.
The pseudo code for my problem is as follows:
for fund in 1 2 3 4
if (FTP is successfully) then
FILE_SENT_fund... (2 Replies)
Dear all,
I have kind of used both the awk/sed command and found them really useful.
But at the necessity I am having right now, I need help.
Actually, I would like to do the following in file script.sh
PATH535="/eos/uscms/store/user/pooja04//analysis2012/535/mc/summer12/002/tt/"
... (2 Replies)
Hi I am new to scripting and have a function in my .sh script file that outputs a html radio button form
weather_forecast_config()
{
echo ""
echo "<html><head><title>Welcome</title></head>"
echo "<body>"
echo "<h2>Weather Forecast - Change City</h2>"
echo "<form name="input"... (5 Replies)
Hi Forum.
I have the following challenge at work that I need to write a script for.
I have a file abc.txt with the following contents:
4560123456
4570987654
4580654321
I want to be able to search/replace in abc.txt - the first 4 characters anything starting with 4560 to 7777; 4570... (3 Replies)