What Type of Oil Does My Car Need?
When it’s time to add or change your vehicle’s engine oil, you’ll find a wide array of oil types available. Here’s important information about how to choose the best engine oil for your vehicle.
Your car owner’s manual has information about the correct type of oil to use in your vehicle. Manufacturers choose the appropriate engine oil for your vehicle based on the viscosity (also called weight) of the product. The correct oil viscosity for your vehicle can change depending on the season, the age of your car and other factors.
Auto engine oil is sold with a label indicating its viscosity. When you buy oil labeled 10W-30, the oil has been tested at zero degrees Fahrenheit and 212 degrees Fahrenheit to see how much the oil thins and thickens when exposed to both hot and sub-freezing temperatures. The first number 10 indicates the thickening of oil in winter, which should be as low as possible to prevent thickening during freezes. The W indicates that 10 is the winter rating. The number 30 shows how resistant the oil is to thinning in high heat.

Too-Heavy Oil Is Not Recommended
Mechanics agree that heavier motor oil thins out less at high temperatures, so a heavier oil offers more protection to moving parts. However, if you use a heavier oil than the one recommended for your vehicle, you could damage the motor. Modern vehicles have very tight clearances between parts, so a too-heavy oil can be too thick for proper engine operation. Before switching to a heavier or lighter oil for your engine, discuss the idea with your mechanic or the auto manufacturer’s help line first.
Engine Oil Is Organic, Synthetic or Blended
Most brand new light-duty vehicle engines use conventional organic oil. As long as you change the oil routinely, conventional oil is fine. Some high-tech vehicles use full synthetic oil because the synthetics have longer-lasting performance than conventional oil. Synthetic oils may be superior to conventional oils for some vehicles, but not all. Synthetic motor oil is also more costly than standard motor oil.
Organic and synthetic oils are mixed together to make synthetic blend oil. Blended oil is cheaper than pure synthetic oil but offers extra protection for vehicles towing heavy loads. A fourth type of oil, called high-mileage oil, is formulated for vehicles with over 75,000 miles of use. High-mileage oils include seal conditioners, viscosity-index improvers and anti-wear additives to address engine problems in older vehicles.
Certifications Are Important Indicators of Oil Quality
Always check packaging before you purchase oil. There should be some type of certification medallion or mark on the oil container to show that the oil was tested for content and weight. Only buy oil labeled with the American Petroleum Institute starburst or donut mark (or another trusted certification).
Go With Tried and True Advice
Engine oil is not something to experiment with. Use the engine oil advised by your manufacturer unless your vehicle is older or under heavy use. Then, ask your mechanic which synthetic, synthetic blend or high-mileage oil is the best choice for your vehicle, and follow their advice.
- Privacy Policy
- Terms of Service
- © 2023 Ask Media Group, LLC

- Quoi de neuf ?
- Marquer les forums comme lus
- Bugs & Suggestions
- Liste des utilisateurs
- Voir l'équipe du site
- Recherche avancée

- error: assignment to expression with array type

- Afficher une version imprimable
- S'abonner à cette discussion…

Bonjour, Me voilà à nouveau confronté à un problème pour lequel je ne vois pas où je me trompe. Si j'écris ceci en une seule ligne : Code : Sélectionner tout - Visualiser dans une fenêtre à part char name [ 5 + 1 ] = "Annie" ; Aucune erreur de compilation. Si je l'écris en deux comme ceci : Code : Sélectionner tout - Visualiser dans une fenêtre à part 1 2 char name [ 5 + 1 ] ; name = "Annie" ; Je reçois cette erreur à la compilation : run.c: In function main: run.c:8:7: error: assignment to expression with array type 8 | name = "Annie"; Si je lis le message d'erreur, je serais en train d'assigner un type "array" à une expression ? Serait-ce dû au fait que le nom du tableau est en fait un pointeur vers le premier élément du tableau ? Mais alors pourquoi ça fonctionne dans le premier cas ? Je suis un peu perdu... d'avance pour vos lumières ! Sébastien

C'est trivial, normal, rien d'extraordinaire du level 0 "débutant" pour les pointeurs. char name [ 5 + 1 ] = "Annie" ; tu crées 1 chaine de caractères littérale en lecture seule et que tu utilises pour initialiser 1 variable lors de sa définition : voir ci-dessous ou mon lien pour de meilleures explications (*) . D'ailleurs, tu n'as pas besoin de préciser la taille, le compilateur la calcule en y insérant le caractère sentinelle ' \0 ' . String literal, cppreference en anglais mais attention C et C++ char name [ 5 + 1 ] tu définies 1 variable de type "chaine de caractères" (tableau de caractères). Et donc pour copier 1 chaîne de caractères il faut utiliser la fonction strcpy ou strncpy dans l'entête string.h (<- 3 liens cplusplus.com en anglais) * : édit suite à la remarque de @Sve@r
Envoyé par foetus C'est trivial, normal, rien d'extraordinaire du level 0 "débutant" pour les pointeurs. C'est pour ça que je poste dans la catégorie "Débuter", j'apprends, mais merci quand même pour l'explication.

Bonjour Envoyé par SebastienBE Si j'écris ceci en une seule ligne : Code : Sélectionner tout - Visualiser dans une fenêtre à part char name [ 5 + 1 ] = "Annie" ; Aucune erreur de compilation. Si je l'écris en deux comme ceci : Code : Sélectionner tout - Visualiser dans une fenêtre à part 1 2 char name [ 5 + 1 ] ; name = "Annie" ; Je reçois cette erreur à la compilation. Je suis un peu perdu... L'écriture en une ligne est un raccourci syntaxique signifiant "création et remplissage". L'écriture en deux lignes (en fait c'est la seconde ligne qui pose problème) signifie "affectation". Or on ne peut pas affecter une string à un tableau. On ne peut que "remplir" un tableau. Donc si tu veux le créer puis le remplir plus tard, tu ne peux plus utiliser le raccourci qui n'est offert que si tu fais les deux opérations ensembles. Pour le remplir il te faut travailler case par case. Fort heureusement il existe une fonction strcpy ( ) qui fait le taf. Tu lui passes le tableau, la string et elle se charge de faire la boucle et mettre le caractère [i] de la string dans la case [i] du tableau. Et elle se charge même de mettre le '\0' qui va bien (à toi de veiller qu'il y a bien la place de l'y mettre mais on en a déjà parlé et tu sembles avoir bien pigé le truc). Envoyé par foetus C'est trivial, normal, rien d'extraordinaire du level 0 "débutant" pour les pointeurs. Pas d'accord avec toi. Ce souci, même si ici il met en jeu un pointeur, n'est pas un souci lié aux pointeurs mais au remplissage de tableaux. Tu aurais la même chose avec int name [ 5 ] = { 1 , 2 , 3 , 4 , 5 } vs int name [ 5 ] ; name= { 1 , 2 , 3 , 4 , 5 } et là sans pointeur. Envoyé par foetus char name [ 5 + 1 ] = "Annie" ; tu crées 1 chaine de caractères littérale en lecture seule. Absolument pas !!! Ce n'est qu'un raccourci de char name [ 5 + 1 ] = { 'A' , 'n' , 'n' , 'i' , 'e' , ' \0 ' } . Rien n'interdit ensuite de modifier le tableau comme tu le sens et écrire par exemple for ( i= 0 ; name [ i ] != ' \0 ' ; i++ ) name [ i ] =name [ i ] +1 pour avoir au final "Boojf". Le tableau a bien été modifié. Ne pas confondre char name [ 5 + 1 ] = "Annie" et char *name = "Annie" ...
Mon Tutoriel sur la programmation «Python» Mon Tutoriel sur la programmation «Shell» Sinon il y en a pleins d'autres . N'oubliez pas non plus les différentes faq disponibles sur ce site Et on poste ses codes entre balises [ code ] et [/ code ]
Envoyé par Sve@r Pas d'accord avec toi. Ce souci, même si ici il met en jeu un pointeur, n'est pas un souci lié aux pointeurs mais au remplissage de tableaux. Tu aurais la même chose avec int name [ 5 ] = { 1 , 2 , 3 , 4 , 5 } vs int name [ 5 ] ; name= { 1 , 2 , 3 , 4 , 5 } et là sans pointeur. Oui tu as raison : j'ai dit pointeur parce qu'on parle de tableau et de chaine de caractères littérales. Mais effectivement c'est + 1 problème de différence en C/ C++ d'initialisation (à la définition) et d'affectation (en C++ c'est le constructeur de copie et de l'opérateur =) Facilité du compilateur pour les types tableau et structure (Plain Old Data - POD - " complexe ") il me semble, à la définition. Mais apparemment, que ce soit 1 tableau de caractères, d'entiers ou autres, à la définition, il y a création d'1 littéral et 1 copie (<- après chaque compilateur peut faire sa tambouille) Envoyé par Sve@r Absolument pas !!! Ce n'est qu'un raccourci de char name [ 5 + 1 ] = { 'A' , 'n' , 'n' , 'i' , 'e' , ' \0 ' } . Rien n'interdit ensuite de modifier le tableau comme tu le sens et écrire par exemple for ( i= 0 ; name [ i ] != ' \0 ' ; i++ ) name [ i ] =name [ i ] +1 pour avoir au final "Boojf". Le tableau a bien été modifié. Ne pas confondre char name [ 5 + 1 ] = "Annie" et char *name = "Annie" ... Effectivement, j'ai trop voulu faire 1 phrase courte et donc en résulte 1 phrase ambigüe De toute façon , tes explications sont claires et c'est 1 sujet de base (comme je l'ai dit). Donc il faut savoir distinguer et maîtriser littéral tableau vs littéral pointeur, affectation vs initialisation, initialisation crochet (que l'on peut utiliser pour les initialisations d'1 structure)
Merci Sve@r pour ces précieuses infos ! C'est très compréhensible et bien expliqué !

Discussions similaires
- Error converting expression to data type int. Par eddyphan dans le forum Développement Réponses: 10 Dernier message: 02/03/2017, 17h15
- Erreur "Type error resolving infix expression "**" as type ieee.numeric_std.u" Par l'acqua dans le forum VHDL Réponses: 1 Dernier message: 24/03/2011, 23h40
- [VB.NET]expression d'un type d'expression Par new_wave dans le forum Windows Forms Réponses: 3 Dernier message: 05/06/2006, 22h40
- [debutant]error: Assignement de String dans un autre. Par Battosaiii dans le forum C Réponses: 2 Dernier message: 17/03/2006, 20h30
- ISO C++ forbids declaration of `ostream' with no type. Par Yoka dans le forum SL & STL Réponses: 9 Dernier message: 15/02/2005, 14h26

- Nous contacter
- Developpez.com
- Haut de page
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.


“error: assignment to expression with array type error” when I assign a struct field (C)
arrays c++ initialization string struct
I'm a beginner C programmer, yesterday I learned the use of C structs and the possible application of these ones about the resolution of specific problems. However when I was experimenting with my C IDE (Codeblocks 16.01) in order to learn this aspect of C programming, I've encountered a strange issue. The code is the following:
During the compilation, the compiler (GCC 4.9.3-1 under Windows) reported me an error that says
"error: assignment to expression with array type error"
on instruction
while if I do
it works. What am I doing wrong?
Best Solution
You are facing issue in
because, in the LHS, you're using an array type, which is not assignable .
To elaborate, from C11 , chapter §6.5.16
assignment operator shall have a modifiable lvalue as its left operand.
and, regarding the modifiable lvalue , from chapter §6.3.2.1
A modifiable lvalue is an lvalue that does not have array type, [...]
You need to use strcpy() to copy into the array.
That said, data s1 = {"Paolo", "Rossi", 19}; works fine, because this is not a direct assignment involving assignment operator. There we're using a brace-enclosed initializer list to provide the initial values of the object . That follows the law of initialization, as mentioned in chapter §6.7.9
Each brace-enclosed initializer list has an associated current object. When no designations are present, subobjects of the current object are initialized in order according to the type of the current object: array elements in increasing subscript order, structure members in declaration order, and the first named member of a union.[....]
Related Solutions
R – typedefs of structs not seeming to go through in header files.
You can't declare a variable inside a case block.
That's not entirely true actually. See here. Should help you clear things up.
Error “initializer element is not constant” when trying to initialize variable with const
In C language, objects with static storage duration have to be initialized with constant expressions , or with aggregate initializers containing constant expressions.
A "large" object is never a constant expression in C, even if the object is declared as const .
Moreover, in C language, the term "constant" refers to literal constants (like 1 , 'a' , 0xFF and so on), enum members, and results of such operators as sizeof . Const-qualified objects (of any type) are not constants in C language terminology. They cannot be used in initializers of objects with static storage duration, regardless of their type.
For example, this is NOT a constant
The above N would be a constant in C++, but it is not a constant in C. So, if you try doing
you will get the same error: an attempt to initialize a static object with a non-constant.
This is the reason why, in C language, we predominantly use #define to declare named constants, and also resort to #define to create named aggregate initializers.
Related Question
- Go – Error: struct Type is not an expression

IMAGES
VIDEO
COMMENTS
A Notice of Assignment is the transfer of one’s property or rights to another individual or business. Depending on the type of assignment involved, the notice does not necessarily have to be in writing, but a contract outlining the terms of...
When it’s time to add or change your vehicle’s engine oil, you’ll find a wide array of oil types available. Here’s important information about how to choose the best engine oil for your vehicle.
Maya Angelou’s poem “Still I Rise” is a type of lyric poetry. The lyric poem expresses the speaker’s feelings about a situation or subject and may or may not rhyme. In “Still I Rise,” Angelou writes about themes of blackness, femininity and...
Это массивы! strcpy(field[0],"####################");. За выделением достаточного места следите сами.
Ответы с готовыми решениями: нужно разбить строку на массив, ошибка: assignment to expression with array type o=0; Дана строка, состоящая из
The Program error: assignment to expression with array type error usually happens when you use an array type that is not assignable or is trying to change the
How to fix the error:assignment to expression with array type #syntax #c #howto #clanguage #error #codeblocks.
How to fix "error:assignment to expression with array type"?, Assignment to expression with array type [duplicate], C Programming: error:
Si je lis le message d'erreur, je serais en train d'assigner un type "array" à une expression ? Serait-ce dû au fait que le nom du tableau
error: assignment to expression with array type. Почему же? Потому что int (*a)[2] — это не "указатель на массив", а указатель на двумерный
prog.c:12:15: error: assignment to expression with array type 12 | s1
“error: assignment to expression with array type error” when I assign a struct field (C). arraysc++initializationstringstruct. I'm a beginner C programmer
mais je n'arrive pas a comprendre exactement ce que ça signifie. Si c'est le cas comment puis-je corrigé cela ? Veuillez m'aidez s'il vous plait
If the left operand is not of class type, the expression is implicitly converted ([conv]) to the cv-unqualified type of the left operand. http