That last part is what i needed to see. I tried it with only one variable to begin with with the same results, and i was trying to figure out how to assign it back to the variable it came from....
Type: Posts; User: Zach Sisk
That last part is what i needed to see. I tried it with only one variable to begin with with the same results, and i was trying to figure out how to assign it back to the variable it came from....
//
// main.cpp
// RGB Converter - C++
//
// Created by Zach Sisk on 9/25/12.
// Copyright (c) 2012 Zach Sisk. All rights reserved.
//
#include <iostream>
#include <string>
So after a lot of messing with it, the function is declared outside of main now.
Now my problem lies with actually calling the function.
I called the function and then had it output the...
Any ideas as to why it wouldn't be working for me?
Here is the code in context.
//
// main.cpp
// RGB Converter - C++
//
// Created by Zach Sisk on 9/25/12.
// Copyright (c) 2012 Zach...
well if i don't declare var i get a compile error saying i used a undeclared variable. also could you explain a bit on the integer division?
basically what i'm trying to do is write a program that...
I'm trying to define a function in C++ and according to jumping into C++ i need to follow the format of
int convert(int var){
int var = 0;
var = var * 100 / 255;
...