Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c++ - Conversion from 'char' to non-scalar type 'Vector<char>' error thrown unknown reason -


error thrown unknown reason

#include "std_lib_facilities.h"  int main()   {       vector<char> shape = ('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');       return(0);   } 

that 1 line vector throws error i've never seen before nor can figure out...

:: g++ tictactoe.cpp -o ttt
tictactoe.cpp: in function int main()':
tictactoe.cpp:5: error: conversion from
char' non-scalar type `vector' requested

see in each tic-tac-toe box start _ , go either x or o, i'm doing without graphics library terminal graphics.

if value same can use following constructor of std::vector:

std::vector<char> shape( 9, 'a' ); 

if part or values distinct can use constructor follows:

static const char ini[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' }; std::vector<char> shape( ini, ini+sizeof(ini) ); 

or

static const char ini[] = "abcdefghi"; std::vector<char> shape( ini, ini+sizeof(ini)-1 ); 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -