Questions tagged [subscript]

A subscript is a number, figure, symbol, or indicator that is smaller than the normal line of type and is set slightly below the baseline.

Subscripts are common in mathematical notation (generally indicating position, such as the index of a variable in a vector) and chemistry formulas (e.g. H2O).

Subscript and superscript (Wikipedia)

625 questions
-3
votes
1 answer

string subscript out of range error when assigning variable to function

In order to become more familiar with cpp I began making a program that takes the derivative of simple polynomials using the power rule. So far, it is working fine for polynomials such as 5x^2+4x. However, if the polynomial contains a constant (like…
num3rical
  • 1
  • 2
-3
votes
2 answers

Swift dictionary subscript with optional values

Dears, this is my code testable in a playground: import Foundation import UIKit enum Error : Swift.Error, LocalizedError { case failedTypeCastingUITableViewCell(name: String, type: Any.Type, reuseIdentifier: String?) var domain: String { …
-3
votes
2 answers

Python TypeError: 'int' object is not subscriptable

I am trying to create a ballot system in which a user can input candidates names and then input preference scores. The program then works out the winner and prints a result. I am getting an annoying return from my console when I run this line of…
Kyran Oliver
  • 3
  • 1
  • 3
-4
votes
1 answer

What are lists in Swift, and how can I use subscripts with a list?

The Swift Programming Guide (Swift 5.1 Edition) says that subscripts can be used to access members of “a collection, list, or sequence.” Collection and Sequence are defined protocols in Swift and are well documented. Do lists exist in Swift as a…
Mark Cowan
  • 93
  • 7
-4
votes
1 answer

How to fix vector subscript out of range in c++

I'm trying to compare elements of the "coordinateList" vector with elements of "Buttons" vector and if four different if-statements are okay to pass them, increase 1 in "countList" vector. But, the problem is that whenever I input 2 numbers for…
Lua
  • 1
-4
votes
1 answer

How can I avoid subscript out of bounds in building my website in R?

So I have a project in R that's a statistical math notebook. I have been adding links to the _site.yml throughout the semester. This weekend I updated R, and for some reason every time I knit .rmds within the notebook I get the following…
Alex
  • 211
  • 1
  • 11
-4
votes
2 answers

Type "Any" has no subscript members while parsing JSON

func parseResponseData(response: AnyObject) { if let feedData = response["feed"] as? [String: Any]{ let entryArray = feedData["entry"] as Any if let entry = entryArray as? [Any]{ for object in entry{ …
-4
votes
1 answer

subscript out of bounds

i keep getting the error subscript out of bounds but i cant seem to fix the problem. i have searched on here and tried all the suggestions but not managed to get it to work. Here is my data (it will need to be pasted into a csv document to get it to…
Summer Gleek
  • 334
  • 5
  • 15
-5
votes
2 answers

C++: Vector subscript out of range

I keep getting the error: Vector subscript out of range . I've spend an hour trying to find out why I keep getting it , it might be something obvious but I can't see it . From the trial and error trying to find out where is the problem I managed to…
-8
votes
2 answers

Swift: access to the content of a dictionary

the codes simple: var dictionnary: [Int: Int] = [25: 32] var test = "dictionary" print (dictionary[25]) print (test[25]) I want to access to the content the dictionary like in the last line of code. I have to detect the name of the dictionary i…
D4vi9
  • 13
  • 4
1 2 3
41
42