Unfortunately, there is not enough information in your question to give you a reasonable answer.
How many posts and how far apart are they?
What are the wind speeds in your area?
What if any snow loads are in your area?
Will you be attaching it to another structure or will it be free standing?
I would suggest that you have a design professional or at least a licensed contractor help you with the design. The reason for this is that a carport is like a big wing when the wind blows and a big shovel when the snow falls.
First, the wind load. In most areas there is wind to deal with. The wind makes a path across your carport like it does on a wing of a plane. Depending on the roofs pitch the wind has to travel over it faster than it does under it. This creates lift and can suck the roof right off of the posts or footings. We frequently have awnings and improperly built structures fail in the wind to some degree or another. Accounting for this is not hard, but it must be accounted for in your design.
In my area of the US there is a fair amount of wind. Design loads are in the 90 mile an hour wind category in my area. You can find out from your contractor, design professional or building official what the design loads are for your area.
Second, the snow load. In my area within a 50 mile range the snow loads can go from 30 lbs per sq ft to 200 lbs per sq ft. This additional load on any roof can be catastrophic if not accounted for in the design. If you have ever shoveled wet snow then you know how heavy just a shovel load can be.
Third will the structure bee freestanding? If it will, then loads are different than if it has another structure to lean on. If it has another structure that it will be attached to, can that structure support the additional loads that will likely be imposed on it?
Back to your original question. "Building a RV carport 18ft tall should you use 4by4 or 4by6 posts? There is no way to tell from the information that you have provided, what will be needed.
Your local building official is a public servant and is likely happy to help you. He can not design it for you but he can help you understand what you need to know to get a proper design. Get you information from a trusted source and save yourself heartbreak down the road. Protect you RV and your carport.