if (name[0] = 'M')
should have to be
if (name[0] == 'M')
=
is used as an assignment operator. it will assign M
to name[0]
.
Use ==
to compare value.
=
assign value from right hand side to left hand side.
==
compare value of right hand side with left hand side.
More Related Contents:
- c++ vectors causing break in my game [closed]
- Why the values {1, 1, 0, -1, -1, -1, 0, 1} and {0, 1, 1, 1, 0, -1, -1, -1} were chosen for dx[dir] and dy[dir]? [closed]
- How can this code be reversed? (recursion)
- Hi, Just Want to Know What This Error Means
- How to determine if a string is a number with C++?
- Installing OpenCV 2.4.3 in Visual C++ 2010 Express [closed]
- Visual C++ equivalent of GCC’s __attribute__ ((__packed__))
- Can’t pass temporary object as reference
- MSVC++ variadic macro expansion
- What’s a very easy C++ profiler (VC++)?
- Visual Studio 2012 __cplusplus and C++ 11
- Difference in performance between MSVC and GCC for highly optimized matrix multplication code
- StdAfx + Header file – Order of inclusion in MFC application
- How do I read from a version resource in Visual C++
- Printing values of all fields in a C++ structure
- How do I compile for Windows XP with Visual Studio 2012?
- Why do I get _CrtIsValidHeapPointer(block) and/or is_block_type_valid(header->_block_use) assertions?
- How to use WinDbg to analyze the crash dump for VC++ application?
- Variadic Template in VS 2012 (Visual C++ November 2012 CTP)
- Fatal error: “No Target Architecture” in Visual Studio
- Strange ambiguous call to overloaded function error
- How to find out cl.exe’s built-in macros
- Problems with running EXE file built with Visual Studio on another computer
- Why are the return values of these doubles -1.#IND?
- OpenCV SURF function is not implemented
- Visual Studio debugger error: Unable to start program Specified file cannot be found
- What is the performance implication of converting to bool in C++?
- how to specify vc11 lambda calling convention
- How do I get at the exception information when using MiniDumpWriteDump out-of-process?
- Incompatible with parameter of type “LPCWSTR”