18,490 Topics

Member Avatar for
Member Avatar for abhi107902
Member Avatar for ArchanaMari
-1
147
Member Avatar for aundriaah

Hello!!! I am trying to get my program to run in Visual Studio 2012, but it won't. I keep receiving errors on my brackets, such as missing function header or 'expected a declaration'. I knew they were messed up from the start, but I just can't seem to get it …

Member Avatar for rubberman
0
315
Member Avatar for brandon66

Alright can you guys tell me why the first call to printOcean prints out the memory address of the arrays rows/cols and the second one prints like its suppossed to with 0's which the array is filled with #include <stdio.h> #include <string.h> //macro #define FLUSH_STDIN(x) {if(x[strlen(x)-1]!='\n'){do fgets(Junk,16,stdin);while(Junk[strlen(Junk)-1]!='\n');}else x[strlen(x)-1]='\0';} //define constants …

Member Avatar for brandon66
0
223
Member Avatar for johans22

Got an array 350x550 of type integer. There are groups of connected or single elements with value 7 in some areas of the array. I need a c or c++ code that identifies each group or element and returns each group's total element(s) plus location of each element in the …

Member Avatar for johans22
0
229
Member Avatar for Toby14

I am Toby Tran. I'm a new member of this forum. I found this forum when I was looking for the help for C programming, and I saw this web was helpful. Basically, I want to say hi to everyone :)

Member Avatar for happygeek
0
134
Member Avatar for sdtechi

#include<stdio.h> int factorial (int); void main() { int a,fact; printf("\nEnter a value:"); scanf("%d", &a); fact= factorial(a); printf("Factorial value=%d", fact); } int factorial (int x) { int f=1,i; for(i=x;i>=1;i--) f=f*i; return(f); } Enter any number: 3 Factorial value = 6 But i did not undartand this program. Mostly in the loop …

Member Avatar for Santanu.Das
0
169
Member Avatar for loken

I wanted to start my own game. I have experience developing in C, C++ and Java. I also have tried out Python and currently I am learning OpenGL. I would like to know if there are preferrable programming languages that are suited best when it comes to game programming. Thanks …

Member Avatar for cherqeza
0
1K
Member Avatar for lewashby

I have a few questions about libraries and header files. Since libraries are binary files and header file are source/text files why do they not just compile the header files along with the rest of the library files? It doesn't make sense to me to have libraries that are binary …

Member Avatar for gusano79
0
198
Member Avatar for Marz_1

Goodmorning guys, I'm trying to compile a simple SDL project with gcc in mac OSX Maverick... This is my main.c file: #include <stdio.h> #include <stdlib.h> #include <SDL/SDL.h> int main( int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO); printf("Grande!\n"); SDL_Quit(); return 1; } In facts my function do nothing but I just want …

Member Avatar for Moschops
0
235
Member Avatar for sdtechi

#include<stdio.h> #include<conio.h> void main() { textbackground(BLUE); textcolor(WHITE); clrscr(); gotoxy(30,9); printf("Welcome to"); gotoxy(30,10); printf("Program2Do"); getch(); } It is a simple color chnaging C program. I had run it on Codeblock. But got error in this line: textbackground(BLUE);

Member Avatar for Member #46692
0
209
Member Avatar for cutedipti

Hello all, I am implementing linked list programs in C. And for that i want to know more about Self Referential Structure in C. If anyone knows more detail information about it then please tell me. I am having one example here which helps you to understand more clearly what …

Member Avatar for mungara
0
1K
Member Avatar for uws101

Why the following printf of the buffer in the readWav() causes segmentation fault just after printing the first row to the screen? Are there any issues with the use of pointer in printf("%d\t %f\n", i, *buffer[i]);? #include <stdio.h> #include "sndfile.h" int readWav(const char *const fname, long *numFrames, int *sRate, float …

Member Avatar for rubberman
0
161
Member Avatar for choconom

Hi, I need to use getopt for a program called like myprogram.c file1 file2 file3 -t. Now I've read some examples about how to use switch cases for options with hypens (-t). But I don't get how to write this for my file1, file2, and file3 (they are arguments that …

Member Avatar for rubberman
0
208
Member Avatar for Ashish_16

What is the output for the code - void main() [ int i=4,x; x=++i_+_++i_+_++i; printf("%d",x); ]

Member Avatar for rubberman
0
122
Member Avatar for chrjs

I am doing this assignment for my computer science course, and I have to write a function that determines if 'x' can fit into an n-bit, two's complement integer. I am not allowed to use any control statements or operators other than the [ICODE]! ~ & ^ | + << …

Member Avatar for mbelenske
0
3K
Member Avatar for Faissalelbarhami

Hii All, i am a begginer at c programming in the first semetser of study, and i am trying to doing my project what is: Diff — The program should compare two text files and list the differences, i.e. lines and columns of the beginning and the end of a …

Member Avatar for Faissalelbarhami
0
410
Member Avatar for Nataliya_1

Filter and process data Download the file population.txt from webcourse. The file is a formatted text file with 3 columns: country, city and population. Read the file and create a short c program to do the following: a.display the name and the population of the city with the highest population …

Member Avatar for Moschops
0
237
Member Avatar for Marz_1

Goodevening, I'm starting coding in C and I've done a little program to understand "struct" function, but... I receive this message: Segmentation fault: 11 I've understood a bit what this problem is about, but I can't understand where it borns on my program. Can you help me? I tank you! …

Member Avatar for Marz_1
0
218
Member Avatar for glao

Hello , I want to scan each row and find in each column the max element and the corresponding index. Then , swap this column with the column which belongs to the main diagonal ( if a condition is valid ). Finally , do the same for the rest rows. …

Member Avatar for glao
0
231
Member Avatar for uws101

int subroutine (char *input, float *buffer) { *buffer = malloc(...) buffer is calculated from input } or flot subroutine (char *input) { *output = malloc(...) buffer is calculated from input return(buffer); } int main(int argc, char *argv[]) { float *data; subroutine(argv[] ...) ... free(data) } 1) which subroutine is recommended? …

Member Avatar for uws101
0
150
Member Avatar for tatendamiriam.mungombe

how to write a c program that allows the user to input grade and get the mark range using the switch statement,and the program only terminates when the user presses the esc key

Member Avatar for Arshad_2
0
138
Member Avatar for Member #917847

I am trying to read a file and follow instructions based on its contents, add them to a linked list. I have the all the file handling written but am still having trouble with pointers and linked lists. The instructions from the input file would go like this i n …

Member Avatar for Arshad_2
0
156
Member Avatar for Marz_1

Hi everybody, I'm Mars and I'm interested in C for now cause I want to enter in a school where they mainly teach C, but getting in is so hard so I prepare myself for this! I've already coded in Python at University where I've done a little game project.

Member Avatar for Member #1094041
0
81
Member Avatar for doris_3

A variable of type double named area holds the area of a circle. Write a statement to output on the screen the area in two decimal places

Member Avatar for rubberman
-1
145
Member Avatar for brandon66

Hey guys, seems like im doing something wrong here 2 occurs 4198861 times* in an array of size 100, i need another set of eyes if anyone can point me in the right direction #include <stdio.h> //proto void printOccurrence(int countArray[], int countSize); //main int main(void) { //variables int arraySize = …

Member Avatar for Moschops
0
206
Member Avatar for Smn

Beginner's question : How is c different from c++? what are the differences? Which one shoul i go for , if i know basic oops (just basics)? **plz provide some genuine answers rather than simply "google"ing ..... I have searched a bit and not yet satisfied.**

Member Avatar for rubberman
0
183
Member Avatar for Muhammad_75

welcome everybody, i am able read my file by asking the filename from user but i am facing a little problem,When i type a name of file which doesnot exist,compiler also shows it with some zeroes, this is my program, please help me,having problem in case 2... #include <fstream> #include …

Member Avatar for mike_2000_17
0
252
Member Avatar for Ahmad Imran
Member Avatar for Smn

I have created a sample program on C.When i try to run on a different system (win 7 64 bit) it is asking for x64 version of the file (of the executable file created ). P.S. - I am not talking about the compiler, but about the executable file created …

Member Avatar for mike_2000_17
0
3K
Member Avatar for Amr_Mohammad_R

Hello everyone I know that my question may be asked before by many people I want to start learning programming games. Have knowledge of the language C, C ++, C-Sharp, and a little Java. Since considerable length of time and I want to start in this field programming games and …

Member Avatar for Heanre
0
239
Member Avatar for markdean1989

I wonder why this program does not do any changes to the text file that I am trying to modify. Scenario: My program uses the Fstream header file, I declared infile as IFSTREAM and outfile as OFSTREAM. I simply want to transfer data from infile to outfile. The data is …

Member Avatar for markdean1989
0
544
Member Avatar for Ahmad Imran
Member Avatar for Duoas
-1
104
Member Avatar for Ahmad Imran
Member Avatar for Duoas
-1
244
Member Avatar for mtatadotcom

hello friends, may anyone help me with a code in c for the mechanism of using an atm machine, conditions 1.acc balance starts at zero 2.do not use global variables 3.loop the main menu after every transaction until user presses exit 4.after every transaction user returns to the main menu. …

Member Avatar for chandrasekhar77
0
6K
Member Avatar for Jack_11

Hello. I'm a thirteen year old programmer. I find it strange how I can learn the core of a language in about half an hour. No joke. I've been programming for about a year, and I know about half a dozen languages. Including C/C++, Lisp, Python, Perl, SQL, Java, C#, …

Member Avatar for <M/>
0
728
Member Avatar for Haroon_3

I want to convert a code from C to C++ , but some statements are very difficult to me , and I have not enough time to make the whole code in C++ from beginning, So anyone who can help me in this regard please comment me then I will …

Member Avatar for dilantha.prasanjith.96
0
493
Member Avatar for Member #1042208

As a part of my assignment I need to solve a problem in which I have to take space seperated inputs. I have already done my homework and stuck at a point where I have to take space seperated integers when number of integers are not predecided i.e whether there …

Member Avatar for Member #1042208
0
284
Member Avatar for Elias_5

using namespace std; int main() { int l; cout<<"Select level: easy--->1 medium--->2 hard--->3"<<endl; cin>>l; int zero(char [][3]); int fonction(char [][3]); char tab[3][3]; for (int i=0;i<3;i++) for(int j=0;j<3;j++) tab[i][j]=' '; int k; do{ k=fonction(tab); zero(tab); } while(k==2); if(k==1) cout<<"win"; if(k==-1) cout<<"loose"; if(k==0) cout<<"tie"; cin>>l; }//end of main int zero(char t[][3]) { …

Member Avatar for glenn_3
0
403
Member Avatar for My_1

I dont know if this a right place to ask but anyway here you go: I am trying count all occurrences word are that are in the file but i dont know how to do it but I can only do in like user have input in not from a …

Member Avatar for glenn_3
0
181
Member Avatar for nitin1

Can anyone give me an idea how to do this? I have a list(C++) of bytearray and I want to fire a post request to the server using CURL library? I have searched a lot and they say to set the CURL_POSTFIELDS but that requires a char * field. I …

Member Avatar for glenn_3
0
164
Member Avatar for better.atbcs

Can anyone please convert this to Javascript? function execute(array $ops) { $stack = new \SplStack(); foreach ($ops as $op) { if (is_numeric($op)) { $stack->push((float) $op); continue; } switch ($op) { case '+': $stack->push($stack->pop() + $stack->pop()); break; case '-': $n = $stack->pop(); $stack->push($stack->pop() - $n); break; case '*': $stack->push($stack->pop() * $stack->pop()); …

Member Avatar for glenn_3
-2
174
Member Avatar for Jack_11

Hello! I'm a programmer that mostly just writes code for operating system kernels, and device drivers. I was wondering how much most people would get paid for doing so.

Member Avatar for glenn_3
0
165
Member Avatar for Leslie_1

Sqlite is a single user database application. It has many capabilities. It would be appreciated if either a link to an example, or some sample code could be shown for creating, inserting and querying a database.

Member Avatar for glenn_3
0
113
Member Avatar for Elias_5

using namespace std; int main() { int l; cout<<"Select level: easy--->1 medium--->2 hard--->3"<<endl; cin>>l; int zero(char [][3]); int fonction(char [][3]); char tab[3][3]; for (int i=0;i<3;i++) for(int j=0;j<3;j++) tab[i][j]=' '; int k; do{ k=fonction(tab); zero(tab); } while(k==2); if(k==1) cout<<"win"; if(k==-1) cout<<"loose"; if(k==0) cout<<"tie"; cin>>l; }//end of main int zero(char t[][3]) { …

Member Avatar for rubberman
0
391
Member Avatar for doris_3

Implement a C function that can perform addition of two 15-digit (positive) integers. As in C the maximum integer number that can be stored in memory is 2147483647 it is not possible to use primitive data types in order to add very large whole numbers. For this reason, you are …

Member Avatar for Jack_11
0
237
Member Avatar for Hadi.M

Hello all, I am trying to self learn the x86 assembly language and I came across a problem that I can't seem to fix. I want to recieve an integer input from the user and convert it to a word. Example: Input = 0 : Output=Zero. Any help?

Member Avatar for gusano79
0
265
Member Avatar for Rimas_1

Hi, I need to read text from file and then as outcome show separate words, but shuffled. I tried few codes but non of these works for me. I'm getting output, but it do not shows words, but some signs only. I'm posting both codes.. #include<stdio.h> #include<string.h> #include <stdlib.h> #include …

Member Avatar for sneekula
0
230
Member Avatar for nitin1

I am damn confused between these two terms. Can anyone explain this using some example? Thanks in advance.

Member Avatar for mike_2000_17
0
2K
Member Avatar for nitin1

This problem is troubling me from so long time. There are N scientists, K black holes, and any scientist can query about radius, size and temperature of any blackhole. You have to answer three kinds of query basically: 1)Given Scientist queried for which blackholes,Given scientist queried for which attributes 2) …

Member Avatar for nitin1
0
174
Member Avatar for Transcendent

What languages do you need to learn to be a software engineer? I can only think of c, c++, and java but do you need to be really really good at it?

Member Avatar for rubberman
0
172

The End.