Hi all, Got the following error when trying to compile my program. “subscripted value is neither array nor pointer” Here”s the code… const float roundOff<> = {0.0, .05, .005, .0005, .00005, .000005, .0000005, .00000005, .000000005}; if(roundOff) { if((digitsPastDecimal > 0) && (digitsPastDecimal { valueUnion.float_variable = valueUnion.float_variable + roundOff; } } The last line is the line that throws the error.Looks like an array to me. Any ideas? Thanks.

Đang xem: Subscripted value is neither array nor pointer nor vector

*

It seems to think roundOff is not an array. Perhaps you”ve got “roundOff” accidentally defined elsewhere in your program? It”ll help if you post your entire program here. Or at least a smaller version of your program that exhibits the same symptom. Also, why “if(roundOff)”? Seems odd to use a pointer like that.

Read more: ivan the terrible vs alexander the great

OMG, do I feel stupid. You are exactly right. roundOff is declared as an integer that is passed into this subroutine. It”s a flag used to determine if the routine should round off the value or not. I called the array bythe same name. How stupid of me… but then, I knew it had to be stupid. It almost always is. Sometimes you just look and look and can”t see what is staring you in the face. Thanks for the input.

Read more: How Far Do Endermen Have To Fall To Die, Tutorials/Enderman Farming

*

Jump to: Jump to- – – – – – – – – – – – – – MPLAB Xpress- – – – MPLAB X IPE- – – – MPLAB ICD4 Debugger- – – – MPLAB PICkit 4 Debugger- – – – MPLAB Snap- – – – MPLAB® Code Configurator – – – – MPLAB REAL ICE- – – – MPLAB ICD In Circuit Debuggers- – – – MPLAB Harmony- – – – MPLAB Simulator- – – – MPLAB 8 IDE- – – – MPASM, MPLINK, MPLIB (assembler, linker, librarian)- – – – MPLAB XC8- – – – HI-TECH C Compilers- – – – MPLAB C18 Compiler- – – – MPLAB XC16- – – – MPLAB C30 Compiler, ASM30, Link30 forum- – – – MPLAB XC32- – – – MPLAB C32 Compiler- – – – Visual Device Initializer- – – – Evaluation and Demonstration Boards- – – – Programmers (MPLAB PM3, PICSTART Plus, PICkit 2, PICkit 3)- – – – Emulators (MPLAB ICE 2000, MPLAB ICE 4000)- – – – Microstick Development Board for dsPIC33F & PIC24H- – – – Linux, Open Source Projects and Other Topics- – – – MATLAB- – – – CML- – – – Tips and Tricks- – – – Other Development Tool Topics- – – – Arriba IDE for PIC MCUs- – – – Curiosity- – – – motorBench™ Development Suite– – – – UNI/O™ Serial EEPROM- – – – Serial EEPROMS – I²C- – – – Serial EEPROMS – Microwire- – – – Serial EEPROMS – SPI- – – – Serial SRAM- – – – MAC Address Chips- – – – Serial EPROM- – – – Parallel EPROM- – – – Parallel EEPROM- – – – ID Solutions and Plug N Play Products- – – – Serial Flash- – – – Parallel Flash- – – – Smart Card- – – – RFID- – – – Literature- – – – MCP2510 Stand-alone CAN Controller – – – – Other Issues<8-Bit Microcontrollers>– – – – PIC Microcontrollers (PIC10F, PIC12F, PIC16F, PIC18F)- – – – Legacy PIC Microcontrollers (PIC14000, PIC17, PICxxC)- – – – Peripherals / Core Independent Peripherals- – – – – – – – Analog (ADC, Comp, DAC, HC I/O, OPA, PRG, SlopeComp, ZCD)- – – – – – – – Waveform Control (CCP/ECCP, PWM, PSMC, COG, CWG, NCO, DSM)- – – – – – – – Timing and Measurements (AngTMR, HLT, PSMC, PWM, NCO, SMT, RTCC, TEMP)- – – – – – – – Communications (EUSART/AUSART, I2C/SPI, USB, CAN, LIN, KeeLoq)- – – – – – – – User Interface (mTouch, HCVD, LCD)- – – – – – – – Logic / Safety & Monitoring / Low Power (CLC, MULT, MathACC, CRC/SCAN, HLT, WWDT, HEF, PPS, IDLE, DO- – – – Documentation (Programming Specifications, Errata, Literature)- – – – Tips & Tricks Solutions Guide & Other PIC Topics<16 bit Microcontrollers & Digital Signal controllers>– – – – dsPIC30F Topics- – – – Programming Specifications- – – – dsPIC33F Topics- – – – PIC24 Topics- – – – – – – – Graphics<32-Bit Microcontrollers>– – – – General PIC32 Topics- – – – PIC32 Beta Release Software (not supported)- – – – FAQs– – – – General MPU Topics- – – – Linux for MPUs- – – – Software Tools for MPUs- – – – Kits and Boards for MPUs- – – – Ensemble Graphics Toolkit– – – – Welcome- – – – MCP250xx devices- – – – Serial Real-Time Clocks (RTCC’s)– – – – Clock Solutions– – – – FPGA devices- – – – FPGA design and debug tools- – – – FPGA IP cores– – – – General– – – – Getting Started with Keeloq– – – – PPP/SLIP- – – – Ethernet- – – – Gateway- – – – TCP/IP Stack v6 Beta– – – – Tutorial Questions– – – – wtbblue.com Registered Consultants Forum- – – – Main- – – – Buy, Sell or Trade– – – – – – – – – – – – Firmware Questions- – – – – – – – Hardware Questions- – – – – – – – App Development Questions– – – – WiFi- – – – Bluetooth Low Energy- – – – MiWi- – – – LoRa®- – – – 802.15.4- – – – Sub GHz- – – – Bluetooth Audio- – – – Voice and Audio- – – – Remote Control- – – – Other Wireless– – – – Welcome- – – – Getting Started- – – – Upcoming changes- – – – Forum FAQs- – – – Forum Support<日本語フォーラム>– – – – 開発ツール- – – – – – – – MPLAB IDE- – – – – – – – MPLAB REAL ICE- – – – – – – – MPLAB ICD2- – – – – – – – MPLAB シミュレータ- – – – – – – – MPLAB C18 コンパイラ- – – – – – – – MPLAB C30 コンパイラ、ASM30、Link30- – – – – – – – 評価/デモ/開発 ボード- – – – – – – – エミュレータ(ICE2000、ICE4000)- – – – – – – – プログラマ(MPLAB PM3、PICSTART Plus、PICkit 2、ICSPなど)- – – – 8ビット PIC マイコン- – – – – – – – コア (命令、リセット、WDT、仕様、・・・)- – – – – – – – 周辺機能 (ADC、PWM、タイマ、UART、・・・)- – – – 16ビット PIC マイコン & DSC- – – – – – – – コア (命令、リセット、WDT、仕様、・・・)- – – – – – – – 周辺機能 (ADC、PWM、タイマ、UART、DMA・・・)- – – – – – – – DSP命令、機能- – – – メモリ製品- – – – – – – – I2C (24xxxx)- – – – – – – – SPI (25xxxx)- – – – – – – – MicroWire (93xxxx)- – – – アナログ & インターフェース製品<中文论坛>– – – – 8位单片机产品- – – – 16位单片机及DSC产品- – – – 模拟及存储产品- – – – 开发工具- – – – C语言及RTOS- – – – 单片机应用技术– – – – wtbblue.com Jobs– – – – Online Shopping– – – – COM2109 – Introduction to I2C- – – – COM3101 – Introduction to Full Speed USB- – – – COM3201 – Designing a Custom USB Peripheral Application- – – – COM3202 – Designing a USB Embedded Host Application- – – – COM4101 – Introduction to Embedded Ethernet- – – – COM4301 – Designing Embedded TCP/IP Monitor and Control- – – – COM4302 – Advanced TCP/IP HTTP Applications- – – – COM5610 – Rapid LIN Design Using a Pre-Certified Configurator- – – – DSP0101 – Introduction to DSP Concepts- – – – DSP0201 – Using DSP Features of the dsPIC® DSC Architecture- – – – DSP0202 – Designing with wtbblue.com's DSP Libraries and Tools- – – – HIF2131 – Designing with wtbblue.com’s Graphics Library- – – – IRF2101 – Adding IEEE 802.11/Wi-Fi® To An Embedded Application- – – – IRF2102 – Wireless Networking with the MiWi™ Development Environment- – – – MCT0101 – Overview of Intelligent Motor Control Solutions- – – – MCT3101 – BLDC Control Techniques- – – – MCT4201 – AC Induction Motor Control using dsPICDEM MCHV development board- – – – MCT7101 – Sensorless Field Oriented Control for PMSM Motors- – – – MCU0101 – Getting Started with Baseline PIC® MCU Architecture, Instruction Set and Peripheral Progra- – – – MCU1121 – Mid-Range Microcontroller Family Peripheral Configuration and Usage Using the HI-TECH® C C- – – – MCU2101 – Getting Started with PIC18 Architecture and Instruction Set- – – – MCU2121 – PIC18 Microcontroller Family Peripheral Configuration and Usage Using the C18 C Compiler- – – – MCU3101 – Getting Started with wtbblue.com's 16-bit MCU Architecture and Instruction Set- – – – MCU3121 – wtbblue.com 16-bit MCU Peripherals (Unit 1)- – – – MCU3122 – wtbblue.com 16-bit MCU Peripherals (Unit 2)- – – – MCU4101 – Introduction to wtbblue.com's PIC32 MCU- – – – PWR3101 – Digital Power Converter Basics using dsPIC33 Digital Signal Controllers (DSC)- – – – PWR3201 – Implementation of Digital Control Techniques for Power Converters using dsPIC® SMPS Family- – – – TLS0000 – Getting Started with wtbblue.com Live Online- – – – TLS0101 – Getting Started with wtbblue.com Development Tools- – – – TLS0999 – Transitioning to MPLAB X from MPLAB 8- – – – TLS2101 – Introduction to the C Programming Language for Embedded Engineers- – – – TLS2130 – Getting Started with MPLAB® C for dsPIC DSCs and PIC24 MCUs- – – – XLP0101 – Low Power System Design with nanoWatt XLP- – – – XLP1101 – Battery Selection for Low Power Embedded Solutions

Previous articleIn A Pound, How Many Cups Of Powdered Sugar In A Pound, How Many Cups Of Powdered Sugar Are In A Box
Next articleHow Many Valence Electrons Does Helium Have ? How Many Valence Electrons Does Helium (He) Have

LEAVE A REPLY

Please enter your comment!
Please enter your name here