15,539 Topics

Member Avatar for
Member Avatar for ericas5

New to C and haven't had any problems until now - I can seem to get straight with passing arrays between functions. Here is what I need to do: Write a program that declares 3 single-dimension arrays named bookPrice, numBooks and totAmt. Each array should be declared in main() and …

Member Avatar for ericas5
0
145
Member Avatar for denis_stoyanov

Well i'm just starting to study recursion and i have a small problem. I'm trying to write a program which generate every six digit combination where every digit is used only one time. I've writed an iterative (i think this is the correct term) : [CODE]#include "stdafx.h" using namespace std; …

Member Avatar for Banfa
0
81
Member Avatar for Muhammadlodhi

[I][B][B][/B][/B][/I] i want to put the answer like user enter any odd number then out put will be like this one if 3 *** * * *** the even rows shows only 1st and last stars LIKE 5 ***** * * ***** * * ***** [CODE] int main(){ int num,i,j,k,l; …

Member Avatar for Muhammadlodhi
0
254
Member Avatar for Iam3R

what is the correct declaration of pointer to a pointer to array of N elements. ( i want to store address of pointer to an array of n elements ) i am using the below declarions seperately , but getting errors. [CODE] int (*p)[4]; int (*p1) (*)[4] = &p; int …

Member Avatar for UncleLeroy
0
139
Member Avatar for kedarm

Hi! I'm trying to use the nanosleep and sleep functions in a program I am trying to write. I first tried this - [CODE] fprintf(stdout,"Hey guys.."); struct timespec t_req, t_rem; t_req.tv_sec = 1; t_req.tv_nsec = 500; if (nanosleep(&t_req, &t_rem) < 0) return 0; fprintf(stdout,"...What's up?");[/CODE] Since the function nanosleep did …

Member Avatar for mitrmkar
0
940
Member Avatar for shahab.burki

Hi, When I assign the value of one structure variable to the other I got the error "incompatible types in assignment". The Code is the following. The Problem line is 91. [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> struct file_data{ char src_ip[18]; char dst_ip[18]; char src_port[8]; char dst_port[8]; char p2p_proto[18]; struct …

Member Avatar for WaltP
0
144
Member Avatar for alcx88

I am having troubles getting my program to work. It is supposed to take integers from a file and put them into an array. Then it is supposed to sort them by the bubble sort algorithm. [CODE]#include <stdio.h> #include <ctype.h> #include <stdlib.h> #define N 10000 int main(int argc, char *argv[]) …

Member Avatar for Adak
0
124
Member Avatar for LMat619

Hello everyone! I am new to this forum (and C programming) but I hope that I will be able to master C help anyone out with problems in the coming months. But I am having trouble with my own program for an assignment. I am asked to simulate a user …

Member Avatar for WaltP
0
223
Member Avatar for Muhammadlodhi

HI i made this program for odd inputs if press 5 then ***** * * ***** * * ***** but not showing the correct answer. write a right code if u can plz thanks alott. [CODE] #include <stdio.h> int main() { int num, i; printf("press any odd num"); scanf("%d", &num); …

Member Avatar for jephthah
-2
288
Member Avatar for Muhammadlodhi

I need your help AT ONCE plz IN C CODE ONLY i have a program to make an array of length 30 and NOW write equation like this ((3+4)-(24/5)) .... the paranthesis must be balance and the output of the operation must be shown IF paranthesis are balanced. HELP ME …

Member Avatar for Nick Evan
-5
132
Member Avatar for Muhammadlodhi

Hey guys and girl i need your help in program only in C CODE user press only odd numbers then the following result has been shown like if 3 then *** * * *** if 5 then ***** * * ***** * * ***** PLZ HELP ME >>>> Thanks

Member Avatar for Salem
-2
359
Member Avatar for geekgirl2011

I am so lost in this programming assignment. Here is what I am suppose to do: A. Define a struct that represents a CAT as follows: A CAT has a weight, name, and a neutered flag, i.e., those are the components of the struct. Use a typedef. B. Declare a …

Member Avatar for jephthah
0
196
Member Avatar for riahc3

Hey I rather not use conio.h for cross compatibility so is there any way to make my own "conio.h" and just include it in my compilation. Thanks.

Member Avatar for jephthah
0
1K
Member Avatar for sangramanand

hi all, i created a window using c, next i want to add a text box in the window. Since am working on 32-bit, i donno which functions to use in that.... pls suggest me the procedure to implement this......

Member Avatar for jephthah
0
45
Member Avatar for reshmasalian

heya, watz de meanin of malloc.h n alloc.h in c-programmin(both are different)? what is the difference between 1 pointer n 2 pointer in link list of stack? wat is the meanin of arrow mark pointer?

Member Avatar for sanji17
-4
192
Member Avatar for urbangeek

the code is: [CODE] slen=strlen(str); for(count=0;count<=slen;count++) { flag=0; if((int)str[count]!=32) { for(count2=count+1;count2<=slen;count2++) { if(str[count]==str[count2]) { flag=1; break; } } if(flag==0) { ar[ar_count]=str[count]; ar_count++; } } }[/CODE] at line 5 the != operator working fine but when i put [ICODE]if(((int)str[count]>=65 && (int)str[count]<=90) || ((int)str[count]>=97 && (int)str[count]<=122))[/ICODE] it's not working.. if you've some …

Member Avatar for WaltP
0
163
Member Avatar for hosam2k

hi all im stuck to my assignment 1. i want to know how to use function search in order i can search each character in a string then count the number of it. for example: given : home alone the output will be : the string has 9 characters including …

Member Avatar for Adak
0
141
Member Avatar for shahab.burki

Hi, I am working on structures. One of the structure member is char array i.e string. When I assign another string to this then it throws the incompatible error. The code is the follwing. The problem line is commented. Code: [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> struct file_data{ char src_ip[18]; …

Member Avatar for shahab.burki
0
172
Member Avatar for Xeros606
Member Avatar for Vytautas

Hello, I'm trying to open file using a function in a header file and I think it works but I'm unsure if it's written as it should be. Should I use double pointer inside the FileOpen function like argv is or not? It also works without double pointers and that's …

Member Avatar for JuhaW
0
105
Member Avatar for shahab.burki

I have created a linked list which stores data from file. However I got stuck when I try to print the contents of Linked List. The code is below 1.Text File [CODE]102.15.12.10 15.14.106.6 1591 1592 bit_torrent 102.15.12.10 15.14.106.6 1591 1592 bit_torrent 102.15.12.10 15.14.106.6 1591 1592 bit_torrent 102.15.12.10 15.14.106.6 1591 1592 …

Member Avatar for JuhaW
0
79
Member Avatar for sree_ec

Hi, i have some questions mostly regarding the memory segments... Can any one help me out.. 1. During a function call in C, where is the return value of the called function stored.. This is mainly a question came when i was thinking of steps during a function call. The …

Member Avatar for sree_ec
0
83
Member Avatar for tquiva

I am trying to modify this function to read input in a noisy environment, meaning the characters received in the input may have extra characters. A protocol that I am trying to implement is to send each digit twice in a row so that unless the receiver gets two of …

Member Avatar for nezachem
0
113
Member Avatar for sunnynight

Dear All, I have a text file containing these lines: [QUOTE]12345 12 123 1234 123456 1234567890 123456789032453 1234567890724832445 12345.123456 12345.123 12.12 12[/QUOTE] And I want to read them from c:\numbers.txt and store them into an array and then do some calculations, then save the results in another file(c:\results.txt). I have …

Member Avatar for Banfa
1
6K
Member Avatar for Etherwind

I'm getting a compiler error in one of my .c's that I don't understand. I'm getting [icode] Tree.c: In function 'newTree': Tree.c:301: error: expected declaration or statement at end of input [/icode] What I don't understand is that newTree and line 301 are completely separate functions. I can get the …

Member Avatar for Etherwind
0
172
Member Avatar for vino4all

How to get the following output using c? ---1 --12 -345 6789 Please guide me with the code. It can be a blank space instead of '-'.

Member Avatar for 0x69
0
359
Member Avatar for Mena samy

hello I am trying to send an array of character but when i receive it in the other processor i receive it with garbage !!! any suggestion? [CODE] #include <stdio.h> #include "mpi.h" int main (int argc, char *argv[]) { MPI_Status s; int size, rank; char line [128]; //char* str="hjfjh"; static …

Member Avatar for Mena samy
0
184
Member Avatar for COKEDUDE

Could someone please tell me what these errors mean and how to fix them. [CODE]inputter.c: In function âget_next_tokenâ: inputter.c:21: warning: initialization makes integer from pointer without a cast inputter.c:17: warning: unused variable âcur_posâ[/CODE] [CODE]/* Get an RPN expression from the keyboard. * Accepts q as indictation that user wants to …

Member Avatar for jephthah
0
175
Member Avatar for xyzt

Hello I try to send DHCP RENEW packets to the network and receive the responses. I broadcast the packet and I can see that it's successfully sent using Wireshark. But I have difficulties receiving the responses.I use packet sockets to catch the packets. I can see that there are responses …

Member Avatar for xyzt
0
300
Member Avatar for vizionary2012

Hi again im a new comer im from Jamaica, i have an assugnment due wednesday and im trying to make my project look proffessional, in C there is a keyword called struct and im familiar with using structures, i was just wondering is there anyway to search for strings or …

Member Avatar for Adak
0
100

The End.