您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ string_to_int函数代码示例

51自学网 2021-06-03 08:30:37
  C++
这篇教程C++ string_to_int函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中string_to_int函数的典型用法代码示例。如果您正苦于以下问题:C++ string_to_int函数的具体用法?C++ string_to_int怎么用?C++ string_to_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了string_to_int函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main() {	printf("%d/n", string_to_int("123"));	printf("%d/n", string_to_int("-123"));	return 0;}
开发者ID:ben12345,项目名称:ProgIntQuestions,代码行数:7,


示例2: assemble_constant

static int assemble_constant(assembly_state_t *state,                        instruction_t *instr, uint32_t addr, uint32_t *offset){    /* PRE:  Given state is initialised. Instruction is valid SDTR instruction.              offset points to sufficient space to store uint32_t. */    /* POST: Loads the assembled constant into relevant bits in number pointed              to by offset. Returns 0 if successful, 1 otherwise. */    assert (state != NULL && instr != NULL && offset != NULL);    uint32_t expression = string_to_int(instr->ops[1]);     /* If the expression is <= 0xff we use a mov function instead: */    if (expression <= 0xff) {        /* Change the format of the operand from =0x... to #...            Will now be in decimal. */        sprintf(instr->ops[1], "#%d", string_to_int(instr->ops[1]));        strcpy(instr->mnemonic, "mov");        instr->no_of_ops = 2;        return EXIT_FAILURE;    } else {        /* We allocate 4 bytes at end of program for the expression: */        add_to_data_aloc_table(state->data_aloc_table, addr, expression);        *offset |= 0x000f0000;    }     return EXIT_SUCCESS;}
开发者ID:alicesibold,项目名称:MorseBerry-Pi,代码行数:30,


示例3: finish_recovery_recv_file_name

static void finish_recovery_recv_file_name(struct aeEventLoop *eventLoop, int sockfd, void *clientData, int mask){	storage_client_t *pClient;	pClient = clientData;		pClient->file.proc = finish_recv_recovery_file;	pClient->file.start_offlen = string_to_int(pClient->file.file_name + 15,4);	pClient->file.file_size = string_to_int(pClient->file.file_name + 19,4);	memcpy(pClient->file.real_file_name,pClient->file.file_name,24);	logDebug("finish_recovery_recv_file_name %s",pClient->file.file_name);	/*get all_trunk_name*/		memcpy(pClient->file.file_name,pClient->file.file_name+8,5);	pClient->file.file_name[5] = '/0';	logDebug("finish_recovery_recv_trunk_name %d,%d,%s",pClient->file.file_size,pClient->file.start_offlen,pClient->file.file_name);	if((pClient->file.fd = open(pClient->file.file_name,O_WRONLY|O_CREAT,0664)) == -1)	{		logError(	"file: "__FILE__",line :%d, "/			"finish_recovery_recv_file_name open file failed,"/			"errno: %d,error info: %s",/			__LINE__,errno,strerror(errno));		*(char *)NULL = 0;	//	exit(1);	}	lseek(pClient->file.fd,pClient->file.start_offlen,SEEK_SET);	nb_sock_recv_file(eventLoop,sockfd,pClient,AE_READABLE);		return ;}
开发者ID:tedcy,项目名称:ydfs,代码行数:33,


示例4: Set_Bonus_Type

void cBonusBox::Load_From_XML(XmlAttributes& attributes){    cBaseBox::Load_From_XML(attributes);    // item    Set_Bonus_Type(static_cast<SpriteType>(string_to_int(attributes["item"])));    // force best possible item    Set_Force_Best_Item(string_to_int(attributes["force_best_item"]));    // gold color    if (box_type == TYPE_GOLDPIECE)        Set_Goldcolor(Get_Color_Id(attributes.fetch("gold_color", Get_Color_Name(m_gold_color))));}
开发者ID:Clever-Boy,项目名称:TSC,代码行数:12,


示例5: main

int main(int argc, char *argv[]) {		char number_array[MAX_LENGTH_ARRAY]; 									// Array che verrà passato alla funzione int_to_string	unsigned int result;													// Il risultato è dove verrà salvato il risultato di string_to_int	if (argc == 2) {														// Se gli argomenti passati sono due 		if (( strcmp(argv[1], "-unit") == 0)) {								// ed il secondo è '-unit'			debug = 1;			unit_test() == 0 ? printf("[+] Unit test Riuscito/n") : printf("[!] Unit test Fallito/n");  // Avvia gli unit test				} else {			printf("[!] Argomento sconosciuto/n");							// se il secondo argomento non è '-unit'			usage();														// richiama la funzione 'usage'			return 1;		}														} else if ( argc != 4) {												// se gli argomenti passati non sono due e non sono neanche 4		usage();															// richiama la funzione 'usage'	} else {		char* numero_da_convertire = argv[1];		char* base_di_partenza = argv[2];		char* base_di_arrivo = argv[3];		int partenza = string_to_int(base_di_partenza, 10);						// Base di partenza convertita in int per passarla alle funzioni		int arrivo = string_to_int(base_di_arrivo, 10);							// Base di arrivo convertita in int per passarla alle funzioni		if (controllo_numero_base(numero_da_convertire, partenza, arrivo) == 1) {			if(controllo_input(numero_da_convertire) == 1) {				if (arrivo == 10) {												// Se la base di arrivo è 10 usiamo string_to_int					result = string_to_int(numero_da_convertire, partenza);					printf("%i/n", result);										// Stampiamo a schermo il risultato				}				else {															// Se abbiamo un numero in base 10 da convertire a un'altra base usiamo int_to_string					int convertire = string_to_int(numero_da_convertire, partenza); // Il numero da convertire deve essere un int per into_to_string					int_to_string(convertire, number_array, arrivo);			// Non stampiamo il risultato perché viene stampato dalla funzione stessa				}			} else {				printf("La stringa inserita contiene dei caratteri non ammessi/n/n");				return 1;			}		} else if (controllo_numero_base(numero_da_convertire, partenza, arrivo) == -1)  {			printf("Il numero inserito non può far parte della base %d/n/n", partenza);			return 1;		} else {			printf("Il numero inserito non può essere convertito nella base %d/n", arrivo);		}	}		return 0;														// Terminiamo il programma} 
开发者ID:puskolon,项目名称:puskolon.github.io,代码行数:50,


示例6: execute_int_commands

//executa alguns comandos como cd e pwd...int execute_int_commands(StringList arguments){    String command = get_string(arguments, 0);    if(equals(command, "cd")){        if(chdir(get_string(arguments, 1))){            printf("Error: no such directory/n");            return 0;        }    }else if(equals(command, "pwd")){        printf("%s/n", get_current_dir_name());    }else if(equals(command, "jobs")){        print_job_list(job_list);    }else if(equals(command,"fg")){        Job aux;         int pid = string_to_int(get_string(arguments, 1));         kill(pid, SIGCONT);        aux = get_by_pid(job_list, pid);         if (aux == NULL) {           //busca por jid            aux = get_by_jid(job_list, pid);            if (aux == NULL) {                printf("Error: job not found/n");                 return 0;            }        }        aux->status = RUNNING;         background = 0;        wait(NULL);     }else if(equals(command,"bg")){        Job aux;         int pid = string_to_int(get_string(arguments, 1));         kill(pid ,SIGCONT);        aux = get_by_pid(job_list, pid);         if (aux == NULL) {           //busca por jid            aux = get_by_jid(job_list, pid);            if (aux == NULL) {                printf("Error: job not found/n");                 return 0;            }        }        aux->status = RUNNING;        background = 1;     }else{        return 0;    }    return 1;}
开发者ID:senechal,项目名称:shell,代码行数:49,


示例7: bin2hex_parse_command_line

bin2hex_input_t bin2hex_parse_command_line( char const* const* cmdline ){    bin2hex_input_t input = {0};    int arg, asize;    error_context_push( "parsing command line", "" );    for( arg = 1, asize = array_size( cmdline ); arg < asize; ++arg )    {        if( string_equal( cmdline[arg], "--columns" ) )        {            if( arg < ( asize - 1 ) )                input.columns = string_to_int( cmdline[++arg] );        }        else if( string_equal( cmdline[arg], "--" ) )            break; //Stop parsing cmdline options        else if( ( string_length( cmdline[arg] ) > 2 ) && string_equal_substr( cmdline[arg], "--", 2 ) )            continue; //Cmdline argument not parsed here        else        {            array_push( input.input_files, string_clone( cmdline[arg] ) );            array_push( input.output_files, string_format( "%s.hex", cmdline[arg] ) );        }    }    error_context_pop();    return input;}
开发者ID:apprisi,项目名称:foundation_lib,代码行数:27,


示例8: string_to_int

void IterDialog::OnApply(wxCommandEvent& event){	// Redraw fractal.	text = textCtrl->GetValue();	number = string_to_int(text);	target->ChangeIterations(number);}
开发者ID:CarlosManuelRodr,项目名称:wxChaos,代码行数:7,


示例9: get_param

   int command_line_params::get_value_as_int(const wchar_t* pKey, uint index, int def, int l, int h, uint value_index) const   {      param_map_const_iterator it = get_param(pKey, index);      if ((it == end()) || (value_index >= it->second.m_values.size()))         return def;      int val;      const wchar_t* p = it->second.m_values[value_index].get_ptr();      if (!string_to_int(p, val))      {         crnlib::console::warning(L"Invalid value specified for parameter /"%s/", using default value of %i", pKey, def);         return def;      }      if (val < l)      {         crnlib::console::warning(L"Value %i for parameter /"%s/" is out of range, clamping to %i", val, pKey, l);         val = l;      }      else if (val > h)      {         crnlib::console::warning(L"Value %i for parameter /"%s/" is out of range, clamping to %i", val, pKey, h);         val = h;      }            return val;   }
开发者ID:CakeZCanaaN,项目名称:metro2033-tools,代码行数:27,


示例10: get_mp3_info

int get_mp3_info (char *file_name, tihm_t *tihm) {  struct mp3_file mp3;  if (mp3_open (file_name, &mp3) < 0) {    mp3_close (&mp3); /* Make sure everything is cleaned up */    return -1;  }  if (mp3_scan (&mp3) < 0) {    mp3_close (&mp3);    return -1;  }  mp3_close (&mp3);  tihm->bitrate = mp3.bitrate;  tihm->vbr     = mp3.vbr;  tihm->samplerate = mp3.samplerate;  tihm->time       = mp3.duration;  tihm->size       = mp3.file_size;  tihm->mod_date   = mp3.mod_date;  tihm->creation_date = mp3.mod_date;  tihm->type      = string_to_int ("MP3 ");  tihm->is_video  = 0;  return 0;}
开发者ID:hjelmn,项目名称:upod,代码行数:27,


示例11: main

int main(){    int_to_string(-50, A);    printf("digit %d is string %s/n", -50, A);    printf("string 12345 is digit %d/n",string_to_int("-12345"));    return 0;}
开发者ID:wizarddewhite,项目名称:data-structures,代码行数:7,


示例12: insertar_nodo

void insertar_nodo(ListaNodo **ptrCabecera, ArbolNodo **ptrarbol, char **palabras, size_t largo_array, int contador){	int n_callback;	if(*ptrarbol==NULL){		ListaNodo *ptrAuxLista=NULL;		ArbolNodo *ptrAuxArbol=NULL;		ptrAuxArbol = malloc(sizeof(ArbolNodo));		ptrAuxLista = malloc(sizeof(ListaNodo));		ptrAuxArbol->children=NULL;		ptrAuxArbol->word="ROOT";		ptrAuxLista->data=ptrAuxArbol;		ptrAuxLista->siguiente=NULL;		*ptrarbol=ptrAuxArbol;		*ptrCabecera=ptrAuxLista;		}	else{		ArbolNodo *ptrAuxArbol=*ptrarbol;		ListaNodo *ptrAuxLista=*ptrCabecera;		if(ptrAuxArbol->children==NULL && contador<largo_array){			n_callback=string_to_int(palabras[0]);			//ListaNodo *ptrAuxLista=*ptrCabecera;			ptrAuxLista = malloc(sizeof(ListaNodo));			ptrAuxArbol = malloc(sizeof(ArbolNodo));			ptrAuxArbol->word=malloc(sizeof(char) * (strlen(palabras[contador]) + 1)); //completar con callbacks			strcpy(ptrAuxArbol->word,palabras[contador]);//revisar cuando llamamos recursivamente			ptrAuxArbol->children=NULL;			//*ptrArbol=ptrAuxArbol;			ptrAuxLista->data = ptrAuxArbol;			ptrAuxLista->siguiente = NULL;			(*ptrarbol)->children=ptrAuxLista;			//puts("ahora es cuando!");			insertar_nodo(&ptrAuxArbol->children, &ptrAuxLista->data,palabras,largo_array,contador+1);		}	}}
开发者ID:WilhelmD,项目名称:Tarea-1-LP,代码行数:34,


示例13: while

void Box::load_movies_seen(){	vector<Movie> Seen;	string s;	float c;	int t;	ifstream file;	file.open("info//Seen Movies.txt");	if (!file.fail())	{		while (!file.eof())		{			getline(file, s);			int i = 1;			string name, aux;			do			{				name.push_back(s.at(i));				i++;			} while (s.at(i) != '/"');			i+=2;			do			{				aux.push_back(s.at(i));				i++;			} while (s.at(i) != ' ');			c = string_to_float(aux);			t = string_to_int(s.substr(i + 1, s.length()));			Movie temp(name, c, t);			Seen.push_back(temp);		}		file.close();	}	seenMovies = Seen;}
开发者ID:RuiVilares,项目名称:TheBox,代码行数:35,


示例14: assemble_expression

static uint32_t assemble_expression(instruction_t *instr){    /* PRE:  Take a valid and legal pointer to an instruction. The address is              exactly [Rn, <#expression>] or "[Rn], <#expression>". */    /* POST: Returns the the value of the expression. */    assert (instr != NULL);     /* We will save the start and end of the string matched in match */    regmatch_t match[1];    regex_t regex;     /* We execute the regex on the instr->instr_str in order to know where the      * expression starts and finishes. The regex execution will save in match      * the index of start and end of the string matched. RE_HASH_EXP is a      * regex to check if a string contains an expression (i.e. #expression) */     check_and_compile_regex(&regex, RE_HASH_EXP, REG_EXTENDED);    regexec(&regex, instr->instr_str, 1, match, 0);       uint8_t start = (uint8_t) match->rm_so;    uint8_t end   = (uint8_t) match->rm_eo;     /* We cut the full_instruction keeping only the expression */    char *exp = cut_string(instr->instr_str, start, end);     regfree(&regex); /* We free the regex used */     return string_to_int(exp);}
开发者ID:alicesibold,项目名称:MorseBerry-Pi,代码行数:30,


示例15: read_value

void read_value (Logical newline, char *string, int *value, int lower_bound){   char response[MAXWORD];   Logical error;   Logical reading = TRUE;   int nmr_items;   while (reading) {      printf ("%s", string);      nmr_items = scanf ("%s", response);      verify_read (nmr_items, 1);      /* read past any comments */      while (response[0] == COMMENT) {	 read_line ();	 nmr_items = scanf ("%s", response);	 verify_read (nmr_items, 1);      }      if (!isatty (0)) printf ("%s ", response);      if (!isatty (0) && newline) printf ("/n");      *value = string_to_int (response, &error);      if (error) 	 printf ("Error in input -- must be integer only/n");      else if ((reading = (*value < lower_bound)))	 printf ("Error: supplied value must be at least %d/n", lower_bound);   }}
开发者ID:fingolfin,项目名称:gap-osx-binary,代码行数:28,


示例16: get_int

int get_int (const char * section, const char * name){    int value = 0;    char * string = get_string (section, name);    string_to_int (string, & value);    g_free (string);    return value;}
开发者ID:suaff,项目名称:audacious,代码行数:8,


示例17: Set_Type

void cBackground::Load_From_Attributes(XmlAttributes& attributes){    Set_Type(static_cast<BackgroundType>(string_to_int(attributes["type"])));    if (m_type == BG_GR_HOR || m_type == BG_GR_VER) {        int r, g, b;        r = string_to_int(attributes["bg_color_1_red"]);        g = string_to_int(attributes["bg_color_1_green"]);        b = string_to_int(attributes["bg_color_1_blue"]);        Set_Color_1(Color(static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b)));        r = string_to_int(attributes["bg_color_2_red"]);        g = string_to_int(attributes["bg_color_2_green"]);        b = string_to_int(attributes["bg_color_2_blue"]);        Set_Color_2(Color(static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b)));    }    else if (m_type == BG_IMG_BOTTOM || m_type == BG_IMG_TOP || m_type == BG_IMG_ALL) {        Set_Start_Pos(string_to_float(attributes["posx"]), string_to_float(attributes["posy"]));        Set_Pos_Z(string_to_float(attributes["posz"]));        Set_Image(utf8_to_path(attributes["image"]));        Set_Scroll_Speed(string_to_float(attributes["speedx"]), string_to_float(attributes["speedy"]));        Set_Const_Velocity_X(string_to_float(attributes["const_velx"]));        Set_Const_Velocity_Y(string_to_float(attributes["const_vely"]));    }}
开发者ID:Clever-Boy,项目名称:TSC,代码行数:27,


示例18: Set_Max_Distance

bool cFlyon::Editor_Max_Distance_Text_Changed(const CEGUI::EventArgs& event){    const CEGUI::WindowEventArgs& windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>(event);    std::string str_text = static_cast<CEGUI::Editbox*>(windowEventArgs.window)->getText().c_str();    Set_Max_Distance(static_cast<float>(string_to_int(str_text)));    return 1;}
开发者ID:Clever-Boy,项目名称:TSC,代码行数:9,


示例19: Editor_Origin_Text_Changed

bool cLayer_Line_Point_Start :: Editor_Origin_Text_Changed( const CEGUI::EventArgs &event ){	const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );	std::string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();	m_origin = string_to_int( str_text );	return 1;}
开发者ID:120pulsations,项目名称:SMC,代码行数:9,


示例20: string_to_int_test

int string_to_int_test(char *string, int base, int result) {	if (string_to_int(string, base) != result)						// se il test non da i risultati esatti	{		printf("Test fallito, %s in base %d dovrebbe diventare %d in base 10, invece risulta %d/n", string, base, result, string_to_int(string, base));		return -1;													// scrive un messaggio di errore ed esce dal ciclo	}	return 0;}
开发者ID:puskolon,项目名称:puskolon.github.io,代码行数:9,


示例21: string_to_int

void cFlyon::Load_From_Savegame(cSave_Level_Object* save_object){    cEnemy::Load_From_Savegame(save_object);    // move_back    if (save_object->exists("move_back")) {        m_move_back = string_to_int(save_object->Get_Value("move_back")) > 0;    }}
开发者ID:Clever-Boy,项目名称:TSC,代码行数:9,


示例22: is_RECORD_CORRECT

bool is_RECORD_CORRECT (const vector<string>& SETrecord, const vector<vector<vector<string> > >& DEF, size_t j, size_t k) {	string actual_key = SETrecord.at(0);	string list_key = DEF.at(j).at(0).at(0);	if (actual_key != list_key) return false;	string actual_value = capslock (SETrecord.at(1));	string list_value = capslock (DEF.at(j).at(k).at(0));	if (actual_key == "LINEWIDTH:" || actual_key == "STRESSANGLE:" || actual_key == "WELLINTERVAL_LENGTH:") {		bool conv_has_failed = true;		double min_value = string_to_double (DEF.at(j).at(k).at(1), conv_has_failed);		double max_value = string_to_double (DEF.at(j).at(k).at(2), conv_has_failed);		string_to_int (actual_value, conv_has_failed);		if (actual_key == "LINEWIDTH:" && conv_has_failed) return false;		if (actual_key == "STRESSANGLE:" && conv_has_failed) return false;		if (actual_key == "WELLINTERVAL_LENGTH:" && conv_has_failed) return false;		double value = string_to_double (actual_value, conv_has_failed);		if (is_in_range(min_value, max_value, value) && !conv_has_failed) return true;		else return false;	}	else if (actual_key == "CLUSTERNUMBER:") {		if (actual_value == "A" || actual_value == "N") {			if (actual_value == list_value) return true;			else return false;		}		else {			bool conv_has_failed = true;			double min_value = string_to_double (DEF.at(j).at(k).at(1), conv_has_failed);			double max_value = string_to_double (DEF.at(j).at(k).at(2), conv_has_failed);			double value = string_to_double (actual_value, conv_has_failed);			if (is_in_range(min_value, max_value, value) && !conv_has_failed) return true;			else return false;		}	}	else {		if (actual_value == list_value) return true;		else return false;	}}
开发者ID:sasvariagoston,项目名称:SG2PS,代码行数:57,


示例23: cDialog

cDialog :: cDialog( double nposx, double nposy, string nidentifier, string ntext, DialogType dialogtype, Uint8 nmax_length /* = 20  */, unsigned int nmin_width ): cSprite( NULL, nposx, nposy ){	stext = NULL;		if( is_valid_number( ntext.c_str() ) ) 	{		text_number = string_to_int( ntext );	}	else	{		text_number = 0;	}	identifier.reserve( nidentifier.length() );	identifier = nidentifier;	text = ntext;		type = dialogtype;	boarder_in = 2;	boarder_out = 2;	text_area = 1;	min_width = nmin_width;		if( type != DIALOG_ONLY_NUMBERS )	{		if( nmax_length < ntext.length() ) 		{			max_length = ntext.length();		}		else		{			max_length = nmax_length;		}		text.reserve( max_length );	}	else	{		if( nmax_length < text_number ) 		{			max_length = text_number;		}		else		{			max_length = nmax_length;		}		text.reserve( 20 );	}		SetColors( colorDarkBlue, colorBlue, colorWhite, colorBlack );	Update_Boarders();	Update_Text();}
开发者ID:Arikado,项目名称:Wii-Homebrew,代码行数:57,


示例24: Set_Delay_Max

bool cRandom_Sound::Editor_Delay_Max_Text_Changed(const CEGUI::EventArgs& event){    const CEGUI::WindowEventArgs& windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>(event);    std::string str_text = static_cast<CEGUI::Editbox*>(windowEventArgs.window)->getText().c_str();    Set_Delay_Max(string_to_int(str_text));    return 1;}
开发者ID:Clever-Boy,项目名称:TSC,代码行数:9,


示例25: set_debug_level

Status set_debug_level(const char *value){    int ivalue;    if (ERROR == string_to_int(value, &ivalue))        return ERROR;    else        _s_debug_level = ivalue;    return OK;}
开发者ID:qh997,项目名称:GetFileList,代码行数:10,


示例26: glsl_dim_from_token

static intglsl_dim_from_token(const string_const_t token) {	string_const_t dim;	size_t ofs = string_find(STRING_ARGS(token), '[', 0);	if (ofs == STRING_NPOS)		return 1;	++ofs;	dim = string_substr(STRING_ARGS(token), ofs, string_find(STRING_ARGS(token), ']', ofs) - ofs);	return string_to_int(STRING_ARGS(dim));}
开发者ID:rampantpixels,项目名称:render_lib,代码行数:10,


示例27: while

void AssociateArray::load_data(const std::string & data, int method){    unsigned int pos = 0;    while (pos < data.size()) {        if (data[pos] == '/x00')            // probably EOF, NULL-byte due to encryption padding            break;        int start = pos;        while (data[pos] != ' ')            pos++;        int len = string_to_int(data.substr(start, pos-start));        pos++;        // read key        start = pos;        while (data[pos] != '/x00')            pos++;        std::string key = data.substr(start, pos-start);        decode_method(key, method);        pos++;        len -= key.size();        // read string        start = pos;        while (data[pos] != '/x00')            pos++;        std::string string = data.substr(start, pos-start);        decode_method(string, method);        pos++;        len -= string.size();        // read value        std::string value = data.substr(pos, len);        decode_method(value, method);        pos += len;        AssociateArrayItem & item = (*map)[key];        item.value = string_to_int(value);        item.string = string;    }}
开发者ID:mattl,项目名称:anaconda,代码行数:43,


示例28: string_to_int

int Usermanage::add_user(User user){    int found = this->find_user("name", user.get("name"));    if(found == -1){        if(this->is_same_name(user.get("name"))) return FAILED_NAME;        this->users.push_back(user);        this->active_user_amount++;        return NEW_USER;    }    else{        if(this->users[found].is_online()) return IS_ONLINE;        //if((user.get("name") != this->users[found].get("name")) && this->is_same_name(user.get("name"))) return FAILED_NAME;        this->users[found].online(string_to_int(user.get("fd")), string_to_int(user.get("port")), user.get("ip"));        this->active_user_amount++;        return OLD_USER;    }    return FAILED;}
开发者ID:snowshana,项目名称:chatroom,代码行数:19,


示例29: parse_threshold_key

static int parse_threshold_key(section_config_t *section, char *value){    if(!strcasecmp(value, "unlimited")) {        section->config.threshold = -1;    } else {        section->config.threshold = string_to_int(value);    }    return OMPI_SUCCESS;}
开发者ID:jimmycao,项目名称:ompi-slurm,代码行数:10,


示例30: ctrlc_hand

//handler para tratar CTRL + Cstatic void ctrlc_hand(int signo, siginfo_t *info, void *data) {    if (background == 1) {        return;     }    else {        Job job = vector_end(job_list);        if (job)            kill(string_to_int(job->pid), SIGINT);             }}
开发者ID:senechal,项目名称:shell,代码行数:12,



注:本文中的string_to_int函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ string_to_number函数代码示例
C++ string_term_tdb_data函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。