---
title: "Can we declare a static function as virtual?"  
description: "Can we declare a static function as virtual?"  
author: "Anonymous User"  
published: 2012-11-17  
updated: 2012-11-19  
canonical: https://www.mindstick.com/forum/469/can-we-declare-a-static-function-as-virtual  
category: "visual c++"  
tags: ["visual c++"]  
reading_time: 1 minute  

---

# Can we declare a static function as virtual?

hi every one\

Can we **declare** a [static function](https://www.mindstick.com/forum/212/can-be-declare-a-static-function-as-virtual) as [virtual](https://yourviews.mindstick.com/view/81341/the-oh-so-fight-for-democracy-virtual-rally-scenes)?

thanks\

## Replies

### Reply by AVADHESH PATEL

hi Goti,\
\
according your question, can we declare a [static](https://www.mindstick.com/articles/12098/the-static-keyword-the-static-methods) [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) as virtual?, answer is\
\
No. The virtual function mechanism is used on the specific object that determines which virtual function to call. Since the static \
functions are not any way related to objects, they cannot be declared as virtual.


---

Original Source: https://www.mindstick.com/forum/469/can-we-declare-a-static-function-as-virtual

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
