Thank you all for help. This has been very helpful.
Type: Posts; User: yahzee
Thank you all for help. This has been very helpful.
You are very right. I just closed my antivirus an it's working. But how did you know it? I have to know after almost 10 hours of searching for solution.
I know. Sorry for misunderstanding. When I uninstalled CB I also deleted all projects, and now created new project called helo. But the problem is same. I have to mention that I used CB before and I...
Set program arguments:
13057
Build Targets:
13058
I am not sure that i told CB to run the wrong file, because i just fresh installed CB and, as part of habit, when created project i...
Build log:
13056
I have just tried to make cpp hello world console app and it works just fine. So the problem is only with c projects. If this is helpful :confused:
I forgot to mention that there is no .exe file in my project's folder...it's sometimes there but when I double click on it it disappears.
I've just fresh installed code blocks 12.11 on my windows 7(x64) OS and tried to launch simple hello world program but no output is produced in console window. I checked compiler path and it looks...
I have problem with solution for my homework. I have to write program which calculates number of girls that we can get their phone number and how much we need to pay. Input looks like this:
5 -...
Try reading this: Arrays in C - Cprogramming.com
If you have array of 5 elements for example. First element's index is zero, second element's index is one, third's two and so on. Basically array[n] goes from 0 to n-1. If you want to delete third...
If you don't know how to do this things maybe this program is still to complex for you and you should learn with something easier than this. Also try with pen and pape. Write down your algorithm and...
Initialize difference as int difference[4] and use it as difference[i] in for loop.
Then if all elements of array called difference are 1 it's a straight.
And again you failed to sort both...
You didn't sort both arrays! Implement it after sort. After you implement it, use printf to see if you are getting correct value. I won't reply anymore if you don't post your solution. You should at...
You are using int i, j, a and c with for loop. You do not need them all. You only need i and j. So get rid of extra variables, leave just the ones you really need. Try to implement new array by...
1 sort arrays
2 use int difference[4] instead int difference
Post your code when you finish this!
Yes, you should sort array first. But don't forget to sort both arrays!
If you assume that difference==4 means that user have straight it's wrong. Because 4h 4s 6d 6c 8c will give you diff==4 and...
There are multiple reasons.
What if user inputs: 5h 4s 3d 2c 6h?
What if user inputs: 5h 6d 7c 7h 9s?
Try printing result for this inputs.
You propably had problems with that because your scanf function wasn't properly implemented.
When you want to calculate difference between all elements, you can use this code:
int i;
int difference=0;
for(i=0;i<n-1;i++) {
difference+=(array[i+1]-array[i]);...
You explained well. But it seems that you don't unerstand me.
1. You have arrays with 127 elements, and you store only five element, so initialize your array on 5 elements
2. Scan for user input...
Your scanf function is not properly implemented, because it doesn't stop on fifth input. Try this:
for (c = 0; c < n; c++){
scanf("%c%c", &array1[c], &array[c]);
...
You will have problem if user enters Manchester United for team. Then you will have two teams, one called Manchester and other called United, which you probably don't want. It happens because %s...
In order to calculate difference try to finish this by yourself:
int array[5];
int i;
int difference=0;
for(i=0;i<5-1;i++) {
array[i] //This is 'i' element...
Then you should use if before while if you need to printf zero for input 0.
Also try writing new program from beggining, do it step by step. At beginning do not use tons of variables, insert them...