15,550 Topics

Member Avatar for
Member Avatar for beyondavatars

I am trying to compile my code and the error is in my ADT module .h file at this line: void printList(FILE* out, ListRef L); The precise error is "list.h:42: error: expected ‘)’ before ‘*’ token" Everything seems fine to me with the rest of the program but my compiler …

Member Avatar for Banfa
0
258
Member Avatar for shankarz
Member Avatar for anjoz

can you guys help me out i dont know any of the c++ functions and i dont know how to convert this tnx in advance [CODE]#include <iostream> #include <stdlib.h> #include <fstream> using namespace std; struct student { char fname[100]; char lname[100]; int id; float cgpa; }; int add( student * …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Don_k

Hey guys. I coded the following program below: but I have a problem... I think its perhaps the logic I have used is not too good... here it goes... The program below should: ask the user to enter a letter ('a' to 'z' or 'A' to 'Z') and outputs VOWEL …

Member Avatar for eilans_10
0
153
Member Avatar for dy/dx

hi its been 2 years since the last time i program in c and this is my first after 2 years. So i'm not that familiar anymore to the syntax in c(especially i'm already programming in java). So my problem is, i don't know if i did something syntactically wrong …

Member Avatar for gerard4143
0
163
Member Avatar for baddawg12

The goal of this program is to create a "bag" array and a function that will calculate the Fibonacci sequence. The "bag" array should be initialized to a size of 2 where the the elements in order are 0 and 1 respectively. For example: array[0] = 0 and array[1] = …

Member Avatar for baddawg12
0
170
Member Avatar for anjoz

Hey im kinda new in file handling so can you guys help me out im having a hard time delete data from my .txt file the one here in my code workes but when I example [CODE] printf("Enter Record to be deleted: "); scanf("%s",del); if(strcmp(line, del) !=0) [/CODE] the data …

Member Avatar for Adak
0
81
Member Avatar for Jeevitha V.K

Hi ... i am doin my B.E in computer science amd i was asked to write a programme ... can anyone help me write a c program that can hang the system ... and can u also tel me how to set it right again...[B][COLOR="Green"]:icon_neutral:[/COLOR][/B] and can u tel me …

Member Avatar for finito
-6
157
Member Avatar for tucanoj

I've been playing around with recursion a little bit, admittedly it's been some time since I've used it, and I'm feeling pretty rusty. I was simply trying to recursively reverse a linked list and wasn't getting anywhere and finally google'd some code and came across the below snippet, [code=c] node …

Member Avatar for tucanoj
0
126
Member Avatar for shankarz

[CODE]main() { char name[10],s[12]; scanf("\"%[^\"]\"",s); }[/CODE] How this scanf will scan?

Member Avatar for shankarz
0
95
Member Avatar for natd

I'm having trouble with my program. It randomises the craps results i.e how many games are won or lost on a particular roll. The problem is, it is supposed run 1000 games but it also randomises the number of games too. Usually between 1000 to 1005. I think it is …

Member Avatar for smurf6189
0
109
Member Avatar for Member 784291

how to make a program run when an external device is plugged in???(program run from the computer not an autorun from the flash)

Member Avatar for wisaacs
0
77
Member Avatar for jhaycee12
Member Avatar for hareaswar

i am also seeing the similar problem.. the code is here.. [code=c] #include<stdio.h> #include<string.h> int palindrome(char *a,int n); int main() { char a[20]; int b,n; printf("Enter the string to be checked\n"); scanf("%s",a); printf("The entered string is "); puts(a); printf("%c%c%c",a[0],a[1],a[2]); //empty line strlen(a); b=palindrome(a,n); if(b==0) printf("%s is palindrome\n",a); else printf("%s is …

Member Avatar for wisaacs
0
367
Member Avatar for praveenshades
Member Avatar for habatra

HI All, i know its a known issue but i am again back with same problem.I am trying to find IP of the host. USed this code.: [CODE]struct sockaddr_in sock_name; int sock_size = sizeof(sock_name); struct in_addr remote_addr; int sockfd, size = 15; if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) …

Member Avatar for CrazyDieter
0
128
Member Avatar for shankarz

[CODE]while((fgets(receiving array,50,file_ptr)!=EOF);[/CODE] How this while is executed?

Member Avatar for Ancient Dragon
0
79
Member Avatar for shankarz
Member Avatar for iqra123

hello! i have to find time in nanosecond of a particular process and for that i am using clock_gettime() function. i tried different codes i got from net but getting same error [QUOTE] error: ‘CLOCK_PROCESS_CPUTIME_ID’ undeclared (first use in this function)[/QUOTE] i have included relavent header file of time also. …

Member Avatar for Banfa
0
2K
Member Avatar for aravind s

Hi. I'm new to daniweb and i am also a novice programmer. I have this assignment to get a shape, then a shape inside that one, and then another inside the second one, and then fill each shape in with different patterns. Here is an example. if the user enters …

Member Avatar for hinduengg
0
245
Member Avatar for Joe Shmoe

I am a VB programmer, so I know a lot about programming. I am just new to C and want to ask a simple question. How can I read a file and use strtok with space as the delimiter and have access to all tokens in memory? The example provided …

Member Avatar for Ancient Dragon
0
123
Member Avatar for MrBentley

[CODE]#include <stdio.h> #include <string.h> #include <ctype.h> int getemail (char * email); int getfirstname (char* firstname); int getlastname(char * lastname); int getphonenumber (char * phone); void main () { char email[30]; char firstname[80]; char lastname[80]; char phone[15]; int namevalid; do { namevalid=getfirstname(firstname); if (namevalid ==1){ printf("You entered: %s, A good name\n",firstname); …

Member Avatar for jonsca
0
205
Member Avatar for genie0582

Hi, I use Runge Kutta to solve for ODEs. (Thanks for someone who provided this runge kutta code. I'm sorry if I didn't put a credit here) I was wondering why when I set TIME 75, the result of y[3] becomes negative at the time around 70+. it is supposed …

Member Avatar for tesuji
0
111
Member Avatar for neotaunter

Please help... This is driving me nuts. I have been searching for an answer to this for a few days now. In c... How do you stop a line feed or new line after pressing enter for an input. I want the printed information to appear on the same line …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for idb_study

[CODE]#include <stdio.h> #include <stdlib.h> /*(*void)displayValue(char* );*/ void main() { char* userInput = (char*)malloc(sizeof(userInput); printf("\n\nEnter : "); scanf("%s", &userInput); printf("\n\nEntered : %s\n\n",userInput); } [/CODE] I have got core dump by running this code. Please suggest.

Member Avatar for mitrmkar
0
300
Member Avatar for jeevsmyd

hi,I am an amateur c programmer.I am using turbo c++ v3.1 compiler. here is a simple program to input and display name and address.. There are two problems in my program 1) telephone number is too long for int and it displays some weird value.. so i tried long int, …

Member Avatar for Adak
0
112
Member Avatar for shirmaster

I made this code and i dont know what to do with my warning in calling function calc() inside the function getOption(). What should i do? need some little help here. [CODE]#include<stdio.h> void getOption(); void getData(int *num1, int *num2); void calc(int option, int num1, int num2); float add(int num1, int …

Member Avatar for shirmaster
0
101
Member Avatar for shankarz
Member Avatar for farah up
Member Avatar for Ancient Dragon
0
41
Member Avatar for mukund_yk

Hello everyone. i tried to write a program to eliminate nos from a file: this is what i mean: 001 #include <QApplication> 002 #include <QPushButton> 003 int main(int argc, char *argv[]) 004 { 005 QApplication app(argc, argv); 006 QPushButton *button = new QPushButton("Quit"); 007 QObject::connect(button, SIGNAL(clicked()), 008 &app, SLOT(quit())); 009 …

Member Avatar for Ancient Dragon
0
94

The End.