Skip to content

Update Account

UpdateAccount

Updates an existing account in the system using the provided account parameters.

int UpdateAccount(const AccountRecord& source_account);

Parameters

  • source_account — constant reference to an AccountRecord structure containing the updated account parameters.

Return Value

  • RET_OK — account successfully updated.
  • RET_* — error code if the account update fails.
  • Return Codes

Example

AccountRecord acc = {};
acc.login = 1002;
acc.group = "demo";
acc.name = "John Smith";
acc.email = "[email protected]";

if (UpdateAccount(acc) == RET_OK) {
    // Account updated successfully
}

Warning

  • The source_account parameters must correspond to an existing account.
  • Only valid and system-compliant values should be passed.
  • Always check the return code to confirm the account was updated successfully.