sscanf shortens it by 20 lines, you can just tell it "lines should like this" and it'll sort it into the arguments you asked for and tell you whether it could. It even protects against overflows if you tell it to (%20s, so it doesn't overrun a 21-char buffer).
This is what bugs me most about the 'scanf is dangerous, strtok is dangerous' camp. As opposed to what, hand-writing your own unchecked ad-hoc string parser? At least C has a parser.
Last edited by Corona688; 09-17-2014 at 05:18 PM..
Hi
i have the following structure
struct S
{
char Mod_num;
char val;
char chr_nm_cd;
}
I am reading a 2GB file and inserting into the structure and writing into a vector.
I feel like only vector will be a right option. I tried with multimap but it is memory intensive and hence i... (1 Reply)
Can someone tell me how to do this?
Just a thought that entered my mind when learning about structs.
First thought was:
struct one
{
struct two;
}
struct two
{
three;
}
one->two->three
would this be how you would access "three"? (1 Reply)
I modified some code I found on Wikipedia concerning maps to see if it would work before applying it to a project I'm working on that has a similar idea.
What I would want is for a user to be able to enter sentences and then be able to distinguish how many times a the person entered a word in a... (4 Replies)
Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks.
... (1 Reply)
Hi,
I have received an application that stores some properties in a file. The existing struct looks like this:
struct TData
{
UINT uSizeIncludingStrings;
// copy of Telnet data struct
UINT uSize;
// basic properties:
TCHAR szHost; //defined in Sshconfig
UINT iPortNr;
TCHAR... (2 Replies)
Hi all, from my understanding I understand that I can use array in this manner.
struct test
{
int a;
int b;
int c;
};
test testing; //creating an array with the structer type
testing.a=1;
testing.b=2;
testing.c=3;
If I'm not wrong we can use array in this manner,... (12 Replies)
hello guys.
i'm new to c++. i've problem using two dimensional vector.
i've a project of making conway's game of life. this is the code that i have made so far.
my problem is how can i give a two dimensional vector through main.
glider.vec1 = vec; is not correct way to give a two... (2 Replies)
In AWK
For 3 individual vectors of the form:
-2.772 -9.341 -2.857
-5.140 -6.597 -1.823
-2.730 -5.615 1.159
I would like to write a script that parses line by line to (i) normalise, (ii) divide by the norm for *each* vector.
I.e.
sqrt(-2.772^2 + -9.341^2 + -2.857^2)=10.154
... (4 Replies)
Discussion started by: chrisjorg
4 Replies
LEARN ABOUT CENTOS
xkbcopykeytype
XkbCopyKeyType(3) XKB FUNCTIONS XkbCopyKeyType(3)NAME
XkbCopyKeyType - Copy one XkbKeyTypeRec structures
SYNOPSIS
Status XkbCopyKeyType (XkbKeyTypePtr from, XkbKeyTypePtr into);
ARGUMENTS
- from pointer to XkbKeyTypeRec to be copied
- into pointer to XkbKeyTypeRec to be changed
DESCRIPTION
XkbCopyKeyType copies the key type specified by from to the key type specified by into. Both must point to legal XkbKeyTypeRec structures.
Xkb assumes from and into point to different places. As a result, overlaps can be fatal. XkbCopyKeyType frees any existing map, preserve,
and level_names in into prior to copying. If any allocation errors occur while copying from to into, XkbCopyKeyType returns BadAlloc. Oth-
erwise, XkbCopyKeyType copies from to into and returns Success.
STRUCTURES
Key types are used to determine the shift level of a key given the current state of the keyboard. The set of all possible key types for the
Xkb keyboard description are held in the types field of the client map, whose total size is stored in size_types, and whose total number of
valid entries is stored in num_types. Key types are defined using the following structure:
typedef struct { /* Key Type */
XkbModsRec mods; /* modifiers used to compute shift level */
unsigned char num_levels; /* total # shift levels, do not modify directly */
unsigned char map_count; /* # entries in map, preserve (if non-NULL) */
XkbKTMapEntryPtr map; /* vector of modifiers for each shift level */
XkbModsPtr preserve; /* mods to preserve for corresponding map entry */
Atom name; /* name of key type */
Atom * level_names; /* array of names of each shift level */
} XkbKeyTypeRec, *XkbKeyTypePtr;
DIAGNOSTICS
BadAlloc Unable to allocate storage
X Version 11 libX11 1.6.0 XkbCopyKeyType(3)