Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
int
- Page 1
Segmentation Fault in C++ Program – Need Debugging
Programming
Software Development
3 Weeks Ago
by YashSmith
…’s my code: #include <iostream> using namespace std;
int
main() {
int
arr[5]; cout << arr[10]; // Accessing out…
Re: Segmentation Fault in C++ Program – Need Debugging
Programming
Software Development
3 Weeks Ago
by Reverend Jim
Don't try to access past the end of the array.
Re: Segmentation Fault in C++ Program – Need Debugging
Programming
Software Development
3 Weeks Ago
by rproffitt
Thanks for the MVE (minimum viable example). But it's just bad code. c, c++ and a lot of language won't stop you from going out of bounds.
Re: Segmentation Fault in C++ Program – Need Debugging
Programming
Software Development
3 Weeks Ago
by Dani
You’re creating an array of 5 integers and then trying to access the 11th integer in the array (assuming the indexes start at 0). You’re getting an out of bounds error because you’re trying to access an array element that doesn’t exist. You can access arr[0] up through arr[4].
Re: Segmentation Fault in C++ Program – Need Debugging
Programming
Software Development
3 Weeks Ago
by Salem
It should be obvious by now from their posting history that the OP is a troll.
Re: Show computer name on a label
Programming
Software Development
1 Month Ago
by toneewa
…;Computer Name: " << ComputerName << std::endl; } } }
int
main() { DisplayComputerName(); String^ managedString = gcnew String(L"Hello DaniWeb…
Re: Fine-tuning OpenAI Vision Models for Visual Question-Answering
Programming
Computer Science
2 Months Ago
by RKE2
Fine-tuning OpenAI Vision Models for visual question-answering is an exciting step forward in AI! It is amazing how these models can combine image recognition with natural language processing to provide accurate, context-aware answers. Cannot wait to see more advancements!
Int isn't working correctly, any ideas why?
Programming
Software Development
12 Years Ago
by ctclements
int
wordpercent = ((count/totalwords)*100); JOptionPane.showMessageDialog(null, "Count: " + … made up from your selected word. I am using "
int
wordpercent = ((count/totalwords)*100); to show that. However, when I…
Re: int main() and return
Programming
Software Development
15 Years Ago
by Fbody
… the ANSI/ISO standards. If you return anything but an
int
, it can lead to system issues. Some compilers will even… complain if you try to return anything but an
int
. As far as value is concerned, zero (0) is considered…
Re: int array to double array
Programming
Software Development
13 Years Ago
by Caligulaminus
Int
and double have completely different memory representations -> No other way of converting the arrays.
Re: int main() or void main() ??!!
Programming
Software Development
18 Years Ago
by may4life
int
main() is used to return 0 at the end. This 0 is returned to the Operating system to denote that the function main() - which is the only function called by the operating system and that's why its so special - has completed successfully. Always use
int
main() and return 0 at the end of it. Dont use void
int * Help
Programming
Software Development
17 Years Ago
by balla4eva33
So I've got "m_starts" as a pointer to an
int
(
int
* m_starts;). And a const char * of "m_str". m_str = "bad,cold,new". How can I allocate "m_starts" to store the starting index of each word in m_str??? For loop?
Int
Programming
Web Development
8 Years Ago
by tqmd1
… functions perform same task? $wh_ope=clean($_POST['whop'])?(
int
)$_POST['whop'] : 0; $wh_ope=(
int
)clean($_POST['whop']); function clean($str) { $cstr=trim…
Re: int * Help
Programming
Software Development
17 Years Ago
by Ancient Dragon
… through the string and count the commans. Then allocate the
int
array large enough to hold that many integers. After that…
Re: int * Help
Programming
Software Development
17 Years Ago
by Ancient Dragon
>>how do i allocate it to the size i want This is c++ so use the [b]new[/b] operator to allocate the array [icode]m_starts = new
int
[NumberOfIntegers];[/icode]
Re: int * Help
Programming
Software Development
17 Years Ago
by Bench
… though. Either way, it works fine with both char and
int
Re: Int isn't working correctly, any ideas why?
Programming
Software Development
12 Years Ago
by deceptikon
…'m willing to be that `count` and `totalwords` are both
int
too, which means your division is performed in integer context… result will be 0. You want something more like this:
int
wordpercent = (
int
)((count / (double)totalwords) * 100) This forces the division into…
Re: Int isn't working correctly, any ideas why?
Programming
Software Development
12 Years Ago
by ctclements
That was the problem, thank you guys. I'm new to java and programming in general. I changed "
int
totalwords" to "double totalwords". The only minor problem I have now is that because I changed totalwords to a double it displays "Total Words: 340.0". Is there any way to make it not display the .0?
Re: Int isn't working correctly, any ideas why?
Programming
Software Development
12 Years Ago
by JamesCherrill
Using a double is a valid solution, but it does have side effects. Personally I would just rearrange the expression so it does the multiply before the divide and keep all the variables as ints.
int
wordpercent = (count*100)/totalwords;
int to string problem, need help quick
Programming
Software Development
16 Years Ago
by notuserfriendly
…// for I/O class Stacky { private
int
maxSize; private
int
[] stackArray; private
int
top; //-------------------------------------------------------------- public Stacky(
int
size) // constructor { maxSize = size;…20); // make new stack char ch;
int
j;
int
num1, num2;
int
interAns; for(j=0; j<input.…
int function(fstream)//illegal argument
Programming
Software Development
20 Years Ago
by smartintelleng
…);
int
setSexe(
int
);
int
setQuery(string);
int
getStats(string);
int
getPosition(string);
int
checkIfStatExist();
int
control(
int
); [B]
int
dataProcess(fstream,fstream,fstream,
int
,
int
,
int
);[/B] private:
int
age;
int
sexe;
int
stat;
int
exist;
int
…
"int[][]" being read as"int[],int"
Programming
Software Development
17 Years Ago
by EMUGOD
…,h7 }; [/CODE] and [CODE] public void paint (Graphics page) { for(
int
i=0; i < 64; i++) { map.interpret(field, page…); } } [/CODE] gets me [CODE]interpret(
int
[],
int
,java.awt.Graphics) in interpreter2d cannot be applied to…
Re: int to string problem, need help quick
Programming
Software Development
16 Years Ago
by notuserfriendly
…)); // do the evaluation that line Type mismatch: cannot convert from
int
to String
Re: int to string problem, need help quick
Programming
Software Development
16 Years Ago
by Ezzaral
So use [ICODE]String.valueOf(
int
).[/ICODE]
Re: int to string problem, need help quick
Programming
Software Development
16 Years Ago
by JamesCherrill
…)); // do the evaluation that line Type mismatch: cannot convert from
int
to String[/QUOTE] Well. you didn't give us the… (unless I missed it). Problem is that doParse returns an
int
and you're trying to assign it to a String… return type to String, or change "output" to
int
, or convert like Ezzaral says.
Re: int to string problem, need help quick
Programming
Software Development
16 Years Ago
by notuserfriendly
[QUOTE=Ezzaral;810855]So use [ICODE]String.valueOf(
int
).[/ICODE][/QUOTE] my man, thank you, didint think of that at all. thanks so much. in the nick of time .
Validate user input (must be a positive int) for ext. function with array parameter
Programming
Software Development
13 Years Ago
by caltech
…CODE]#include <iostream> using namespace std;
int
getNumAccidents (string);
int
findLowest (
int
arr[]);
int
main() { string Boroughs[5] = {"…return 0; }
int
getNumAccidents (string instance) {
int
numAccidents; cin >> numAccidents; return numAccidents; }
int
findLowest (
int
arr[]) {
int
Lowest = arr[0…
int mixed always returns huge negative number
Programming
Software Development
18 Years Ago
by dmmckelv
…][color=#000000]:[/color] [color=#0000ff]
int
[/color] numerator; [color=#0000ff]
int
[/color] denominator; [color=#0000ff]
int
[/color] mixed; [color=#0000ff]float…definition [/color]Rational::Rational( [color=#0000ff]
int
[/color] mixed, [color=#0000ff]
int
[/color] numeratorPart, [color=#0000ff]
int
[/color] denominatorPart) [color=#008000]//constructor,…
Int conversion (ASCII?)
Programming
Software Development
14 Years Ago
by MasterGberry
…value 214. So i assume its being reset. Maybe the
int
value (32 bit vs 16 bit?) is different in C… code [CODE]var ob0 = (
int
)exe[item.Pos]; var ob1 = (
int
)exe[item.Pos + 1]; var ob2 = (
int
)exe[item.Pos + 2]; var… code [CODE]
int
ob0 = (
int
)exe[item.Pos];
int
ob1 = (
int
)exe[item.Pos + 1];
int
ob2 = (
int
)exe[item.Pos + 2];
int
ob3 = (
int
)exe[item.Pos…
Re: Int conversion (ASCII?)
Programming
Software Development
14 Years Ago
by MasterGberry
item.Pos is an
int
, and exe is a char array, …[CODE]
int
ob0 = (
int
)exe[item.Pos];
int
ob1 = (
int
)exe[item.Pos + 1];
int
ob2 = (
int
)exe[item.Pos + 2];
int
ob3 = (
int
)exe[item….Pos + 3]; if (ob0 < 0) {
int
…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC