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;
...
that didn't work. on "cin" i can type any number i want, but only the first character shows up.
it's really annoying.
I'm currently working on a project that simply converts a DMX value to a 100% value.
I have all the code I need and it works properly, but when i try to run it in xcode, it only shows the first...
Gotcha, didn't think about that. Thanks.
Could you explain how I should use a macro everywhere? And point out which term is considered a Macro?
Also thanks for the spelling. I can never spell Fahrenheit. And I couldn't figure out spell...
Gotcha. I thought i did a pretty decent job, and actually preferred it to the "solution." Sure I could enable it to input bigger numbers I guess. But overall I was pretty happy with it.
That was a loop to ask them to re-enter a temperature if high > the upper limit. I see nothing wrong with that bit of code.
Want to explain what is wrong with it?
So after a bit of work and refinement (the code i started with is commented out) this is what I came up with.
/*
* File: main.c
* Author: zachsisk
* Temperature Conversion Program
*...
I wasn't saying that I was using the Turbo C complier, haha. These are books on Turbo C that my grandpa gave me, they came with original floppies, haha.
I am using NetBeans for mac right now. I was...
No I haven't, I was reading a book for school called "C Programming For Engineering & Computer Science". Now i'm thinking that this other book from my grandfather might be better. Although it's...
So, I'm on a mac, which complier do you recommend? Right now i'm using NetBeans, as it's the only program that will make anything. Same code on different ones and they always fail.
It was actually a book that told me that. It is the book that was assigned as reading for my class. My grandfather gave me his Borland C books, which do not use void. But I never checked them until...
Yeah, I understood that. lol. Like I said initially, i'm not completely new to the concept of programming, just new to actually doing it.. lol. Especially in this C language..
thanks for that advice. i'm not looking at the answer until I think I have something satisfactory. Then i'll compare and see if there are better ways to do it.
Thanks for that. I really don't understand why tutorials tell you to type something that is considered bad practice and in most cases wrong altogether..
thanks. Right now i'm working on the practice problem of converting temperatures. And I think i'm doing pretty good for a beginner.
/*
* File: main.c
* Author: zachsisk
*
* Created on...
well since the thread has already been moved, i'll stick with regular C.
Also I found that cout must be for C++ and not C
Also could someone briefly explain the difference between like C, ANSI...
It was actually intended for the C programming language in general, covering most variants. C, C++, C# specifically.
Thanks for both of those answers! Matticus gave me some beginning problems to program, and the SPOJ looks like it will be nice once i've developed my skill set a little more.
Also, I am making my...
So, basically i'm new to programming especially in C. I can do web scripting, so I'm not completely new to the concept of programming.
But right now i'm a student in a computer engineering degree. I...