12-15-2004
Doubt in structure -- c++
hi,
Small sample program
#include <iostream>
using namespace std;
typedef struct vijay {
int a;
int b;
}VIJAY;
void main ()
{
VIJAY v;
cout << "a=" << v.a<<endl;
cout << "b=" << v.b<<endl;
if(v) {
cout << "Entered" << endl;
}
}
I am getting error :
line 17: Error: An expression of scalar type was expected.
How to solve this ........
10 More Discussions You Might Find Interesting
1. HP-UX
Hi all,
I would like know if we can enter a command under UNIX (HPUX 10.xx) to know the hard ram memory structure .
Thanks
Dorian (1 Reply)
Discussion started by: Dorian
1 Replies
2. UNIX for Dummies Questions & Answers
echo name the file that you want to read
read answer
if
then
echo you must enter a file name
fi
cat $answer
im trying to catch the error if user forget to enter the name of the file
anyone can help me ?
thanks:confused: (4 Replies)
Discussion started by: props
4 Replies
3. UNIX for Dummies Questions & Answers
Hi all
Is it possible to copy a structure of a directory only.
e.g.
I have a file with the following entries that is a result of a find :-
/dir1/dir2/file.dbf
/dir1/dir2/dir3/file1.dbf
/dir1/file.dbf
I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies
4. UNIX for Advanced & Expert Users
Hi,
I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies
5. Shell Programming and Scripting
I have writen the following code to show the dirctory structure. Can any body help me for using the recursive function in this code?
echo "-(0)"
echo "$HOME-(1)"
cd ~
set *
for i in `ls $HOME`
do
if
then
echo ".....${i}"
cd... (5 Replies)
Discussion started by: murtaza
5 Replies
6. Programming
Hello Groups
I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records.
if we loop it in both the structures it is going to consume time.
I am looking for a simple... (3 Replies)
Discussion started by: dhanamurthy
3 Replies
7. UNIX for Dummies Questions & Answers
How can we find size of a structure with out using sizeof operator?
Thanks,
Harika (2 Replies)
Discussion started by: harikamamidala
2 Replies
8. Shell Programming and Scripting
Hi all,
I was wondering if it was possible to put a command in an if statement.
I wrote something like:
grep -q 'santiago' file
(( $? )) && echo text not found || echo text found
I would like to write something like this but it doesn't work:
(( grep -q 'santiago' file )) && echo text not... (2 Replies)
Discussion started by: chebarbudo
2 Replies
9. UNIX for Dummies Questions & Answers
Hi...
I have a directory which has multiple directories and sub directories inside...
what command should i use to get a list of all these directories, without the filenames.... (2 Replies)
Discussion started by: saharookiedba
2 Replies
10. Shell Programming and Scripting
Im reading a lot about wget and have really enjoyed using it. However I see a lot of tutorials that will show several ways. I want to be able to write scripts in gedit so I was wondering what is the best process to do this instead of just running them in the terminal?? (3 Replies)
Discussion started by: graphicsman
3 Replies
LEARN ABOUT DEBIAN
__gnu_cxx::char_traits
__gnu_cxx::char_traits< _CharT >(3cxx) __gnu_cxx::char_traits< _CharT >(3cxx)
NAME
__gnu_cxx::char_traits< _CharT > -
SYNOPSIS
Inherited by std::char_traits< _CharT >.
Public Types
typedef _CharT char_type
typedef _Char_types< _CharT >
::int_type int_type"
typedef _Char_types< _CharT >
::off_type off_type"
typedef _Char_types< _CharT >
::pos_type pos_type"
typedef _Char_types< _CharT >
::state_type state_type"
Static Public Member Functions
static void assign (char_type &__c1, const char_type &__c2)
static char_type * assign (char_type *__s, std::size_t __n, char_type __a)
static int compare (const char_type *__s1, const char_type *__s2, std::size_t __n)
static char_type * copy (char_type *__s1, const char_type *__s2, std::size_t __n)
static constexpr int_type eof ()
static constexpr bool eq (const char_type &__c1, const char_type &__c2)
static constexpr bool eq_int_type (const int_type &__c1, const int_type &__c2)
static const char_type * find (const char_type *__s, std::size_t __n, const char_type &__a)
static std::size_t length (const char_type *__s)
static constexpr bool lt (const char_type &__c1, const char_type &__c2)
static char_type * move (char_type *__s1, const char_type *__s2, std::size_t __n)
static constexpr int_type not_eof (const int_type &__c)
static constexpr char_type to_char_type (const int_type &__c)
static constexpr int_type to_int_type (const char_type &__c)
Detailed Description
template<typename _CharT>struct __gnu_cxx::char_traits< _CharT >
Base class used to implement std::char_traits.
Note:
For any given actual character type, this definition is probably wrong. (Most of the member functions are likely to be right, but the
int_type and state_type typedefs, and the eof() member function, are likely to be wrong.) The reason this class exists is so users can
specialize it. Classes in namespace std may not be specialized for fundamental types, but classes in namespace __gnu_cxx may be.
See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html for advice on how to make use of this class for unusual character
types. Also, check out include/ext/pod_char_traits.h.
Definition at line 85 of file char_traits.h.
Author
Generated automatically by Doxygen for libstdc++ from the source code.
libstdc++ Tue Nov 27 2012 __gnu_cxx::char_traits< _CharT >(3cxx)