10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi guys,
i m new to shell script..
i dont know how to type cast string into integers and i mention my problem below..
date="21091988"
month=$((${date:2:2})) # extract the month from previous date variable
temp=$(($month*23))
when i am trying to calculate the temp value i got the... (5 Replies)
Discussion started by: raadhaakrishnan
5 Replies
2. Shell Programming and Scripting
I have a question about the type of this variable
checkU= sudo cat /etc/passwd: grep $uname: wc -l
I write a script to check the existent of username that get from the keyboard. If there is no username,it will create the username else it show the 'Duplicate name" message.
The problem is it... (4 Replies)
Discussion started by: thsecmaniac
4 Replies
3. Programming
Hi
In the following code, why the variable 'i' still retains the value 10 instead of 11? Why it is not possible to alter this variable's value?
int main() {
const int i = 10;
*(const_cast<int*>(&i)) = 11;
cout << i << endl; // Ans: 10
} (6 Replies)
Discussion started by: royalibrahim
6 Replies
4. Programming
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)
Discussion started by: royalibrahim
6 Replies
5. UNIX for Advanced & Expert Users
I am having a doubt with type casting in C. Very often in network programming, we have something like this:
char *data = ...;
struct iphdr *ip = (struct iphdr *) data;
where iphdr is define in netinet/ip.h.
Let us say that the size of the content of held by 'data' is much more than... (1 Reply)
Discussion started by: radiatejava
1 Replies
6. Shell Programming and Scripting
Hi I'm trying to write a script which takes an integer as input and checks for files with size > input and displays it on screen.
The code I've tried :
echo 'Enter the min file size expected'
read filesize
du -ah <folder name> | awk -F: '$1>int(filesize) {print $1,$2)' is always... (28 Replies)
Discussion started by: vivek.bharadwaj
28 Replies
7. Shell Programming and Scripting
Hello:
Is there any way to tell the type of a passed or entered variable, if it is a string or integer,...etc.
Thanks a lot (2 Replies)
Discussion started by: aladdin
2 Replies
8. Programming
$ gcc -Wall -Werror struct.c
struct.c: In function `main':
struct.c:18: error: dereferencing pointer to incomplete type
$ cat struct.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*Declaration of structure*/
struct human
{
char *first;
char gender;
int age;
} man,... (3 Replies)
Discussion started by: amit4g
3 Replies
9. Shell Programming and Scripting
hello all how can i get the type of variable in perl like
typeof(var); in javascript for instance ? to know if the variable is int or string ? (2 Replies)
Discussion started by: umen
2 Replies
10. Shell Programming and Scripting
Dear All,
I am trying to write an script to calculate geometric centre of selected residues of a protein structure. Say I have a PDB file (a text containing the x, y, and z coordinates of atoms of a protein). I want to extract the X coordinates of the atoms belonging to the interested residues... (2 Replies)
Discussion started by: siavoush
2 Replies