» Home » assigning » Page 1
Assigning a “const char*” to std::string is allowed, but assigning to std::wstring doesn't compile. Why?
by sorcerermerlin in Programming Languages

I assumed that std::wstring and std::string both provide more or less the same interface.


So I tried to enable unicode capabilities for our application


# ifdef APP_USE_UNICODE
typedef std::wstring AppStringType;
# else
typedef std::string AppStringType;
# endif

However that gives me a lot of compile errors when -DAPP_U


Cocoa: Why assigning a frame to a frame doesn´t work but assigning bounds does
by wafe in Programming Languages

I´ve been reading the different questions ( Cocoa: What's the Difference between the frame and the bounds?, iOS Programming: Frame, Bounds and Center) related to the difference between frame and bounds but still I don´t understand why when something like this:


UILabel *newMark = [[UILabel alloc] initWithFrame:self.frame];
newMark.text = @"|A3";
[self addSubview:ne

assigning function to variables and assigning variables to functions(?) in Javascript
by dummyadresse in Javascript

I'm learning javascript by dissecting a few scripts written by other people that I have used before (stackoverflow is essential to this!). This bit of code (and I cut a lot from the middles to make the code easier to read, and all comments are mine) comes from fullCalendar.js, a jquery plugin.


I'm not sure what the author is doing here:


function EventManager(options,

FOR /F not assigning the last value
by manivel in Web Design

Today is 11/01/2013


I have the following .bat file:


@ECHO OFF
:: Take the output from DATE and assign it to variable today
FOR /F "tokens=* delims=/" %%i IN ('DATE /T') do SET /A today=%%i
ECHO %today%
PAUSE

and it outputs:
11


If I am telling the FOR to iterate over the 3 tokens and then output the resulting va


Assigning int x = 'abc' ;
by Chris in Programming Languages

I was doing a code review and I saw assignment of single quoted strings to enum values:


enum
{
Option_1 = 'a',
Option_2 = 'b'
} ;

While this makes for slightly more readable code (though the enum's meaning should be pretty much in the name of the num), it looks silly to me.


I didn't know you COULD do that and after studying it, I can see that

TAGS : Assigning

Assigning char to int
by walkah in Programming Languages

I'm making a poker game, and i have the shuffle function (based in other answer here).
Now my problem is, how can i assign the name of the card to each number of the array, for example i want cartas[3] = "J spades".


I thinked in a bidimensional array, but they can't have two different types of data, i think. I hope someone can help me.


/* This is the array, cart
TAGS : Assigning char

Assigning an ID to a new object
by cubeless in Development Tools & Services

I've got a simple domain object, Movie, with the following constructor:


public Movie(string title, int year = 0, Genre genre = Genre.None, int length = 0, IEnumerable<string> actors = null) { ... }

There is no ID parameter, as there couldn't be a way to know up front what the ID would be. Movie does have an int Id

TAGS : Assigning object

assigning a value to e.value index
by Pakistan in Development Tools & Services

I am reading in data from a google form, I am using onFormsubmit and have the following assignment


var MEDS = e.values[2];


This is not a "required" question on google forms so it can be left blank.


Problem is when I try to access the MED contents via line.attendText, (this is when the user has submitted the data and the script is running). I get the fo


Assigning a value to a gridview
by Matt Croydon in Programming Languages

I am attempting to display data from my database into a gridview
How can I assign the value to the gridview?


while (rdr.Read())
{
///Console.WriteLine(rdr[0]);
gridview1.Text = rdr[0];
}

Assigning a value to variable
by pad in Programming Languages

If I wanted to convert binary into decimal, is there way I could do this:


Assuming:


newState[i-2] = 0,
newState[i-1] = 0,
newState[i] = 1
binary = newState[i-2], newState[i-1], newState[i]; // but if I did this, bin = 0, not 001.

I want to do this so I can pass binary into another method to convert into decimal.


Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .