operands

What Does Adding One to a Character Array in C Do?

I'm looking through some code for learning purposes. I'm working through this portion of code. // e.g. const unsigned char data={0x1,0x7C ... } unsigned char buf[40]; memset(buf,0,40); buf[0] = 0x52; memcpy(buf+1, data, length); // What does buf+1 do in this situation? On the last line where memcpy is called what does buf+1 do? buf is...

syntax case statement with calculated column

Hello, What is the right syntax for this query in MS-SQL 2005? select case app.NAMED_USER WHEN app.NAMED_USER > 50 AND app.NAMED_USER <=0 THEN 4 WHEN app.NAMED_USER > 500 THEN 9 WHEN app.NAMED_USER > 500O THEN 12 FROM APPLICATION app WHERE app.NAME LIKE '%application 5%' i get a error message below, which I can not decipher.....

Multiplying char and int together in C

Today I found the following: #include <stdio.h> int main(){ char x = 255; int z = ((int)x)*2; printf("%d\n", z); //prints -2 return 0; } So basically I'm getting an overflow because the size limit is determined by the operands on the right side of the = sign?? Why doesn't casting it to int before multiplying work? In this case I...

map operator [] operands

Hi all I have the following in a member function int tt = 6; vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt]; set<int>& egressCandidateStops = temp.at(dest); and the following declaration of a member variable map<int, vector<set<int>>> m_egressCandidatesByDestAndOtMode; However I get an error when compiling (Intel...

how does vbscript evaluate string greater than string?

i'm converting some vbscript from an asp app and ran across a line in the form of If sCode > "" Then where I expect sCode to contain a string. i know enough vbscript to plod through it but i'm not sure of the behavior of some quirkier statements. c# will not accept that as a valid condition check. what is an equivalent c# statement? ...

CS0019 Operator cannot be applied to operands of type 'bool' and 'int'

This program is in response to the assignment: "Create a method named Sum()that accepts any number of integer parameters and displays their sum. Write a Main()method that demonstrates the Sum()method works correctly when passed one, three, five, or an array of 10 integers. Save the program as UsingSum.cs." from Microsoft® Visual C#® 2...