Code so far:
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
Type: Posts; User: me77
Code so far:
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void){
How would I make them numeric values... an array can't really be an "int" right?
So I tried:
int val2, val2;
val1 = ar[0][0];
val2 =ar[0][1];
but when i display their contents after...
Hey,
Here is my code:
#include <iostream>
using namespace std;
int main(void){
ah yes, you're right its actually 57. so there's no way of just normally adding or subtracting array values?
So I have an array : isbn[20][20]
and then i input : 978-0-306-4061
then i try to multiply the first character, 9, by one :
s = isbn[0][0] * 1;
and instead of 9 i get.. 56.. i don't get...
Alright thanks :D
You were right it was the new line :-). I've fixed it and it works perfectly now.. thanks for all the help !
Let me know if I could've done this in a better way:
for(i=0;sent[i];i++){
...
Problem solved. I converted the character a to int and now it works great....
#include <stdio.h>
#include <stdlib.h>
int main(void){
int i,a;
Aha, it converts 'a' into its ascii format. Lets see if I can fix this..
BTW, I don't understand what the gar = getchar() is for
I don't know if this is what you meant, but now the 0 terminates the program and the encoding the number has been fixed, but the actual interpreting of the sentence has totally screwed up. I'm...
But for the problem the input must be: first line- the number to increment and the second line the sentence. So I don't see how the number could also be in the sent array.
Ok. So I added this:
while(scanf("%d",&a) && a != 0){
Like always, It still encodes the number itself which I don't get how to stop because it should ask for the next input.
For...
Thanks for your replys. I've updated the program and now have partial success.
int main(void){
int i=0,a;
char sent[100];
while(scanf("%d",&a) != '0'){
...
I'm trying to create a program that first takes in a number that determines the amount of letters the second input (sentence) will go up. This is what I have so far:
#include <stdio.h>
#include...
oh that makes sense getchar lol thanks.
I don't even know if i did the rest of this right, but the first loop that looks for 0 doesn't even work and i don't know why.
It's supposed to first accept an integer n that will be used to...
oh wow such a small mistake to me forever .. thanks a lot now works
int main(void)
{
int nums[3][5];
int i,j;
printf("Enter 3 sets of 5 double numbers: ");
I'm new to multidimensional arrays and I just don't understand how to write into them.. help?
int main(void)
{
int nums[3][5];
int i,j;
ok so 0 and 1 i get.. it prints out either 0 or 01
now lets take 2 for example.. r = 0
2 is = to 2 so 2 / 2 is 1
now r =1 r is < 2 so it prints 01
but thats wrong. how am i looking at this...
I was hoping someone could please walk me through on how this works.
/* Code that accepts a user number and puts it into a function to_binary */
void to_binary(int n)
{
int r;
#include <stdio.h>
#include <wininet.h>
#include <windows.h>
void asdf(void);
int main(void)
{
asdf();
return 0;
}
for some reason i was thinking that while it was falso it would keep on going lol.. dont know why.. but i fixed it by changing the values of da and de of what they would be after one day. thanks
er hahahah dur.. lol
I'm so stumped on why this doesn't work. It displays:
It took 1 days for Deirdre to make more then Daphne. Daphne has $100.00 and Deidre has $100.00.
But shouldn't because 100.0 is not > then...
oh lol i didnt even notice the changes.. lets try it out
ah ic now.. thanks for the help NeonBlack :)