174 Topics

Member Avatar for
Member Avatar for initialfresh

If anyone can help me finish this and point out what had to be done to make the program work, that would be great. -ask for how many days user wants to enter from 1-365 (validate) -ask for temperature for each days between -60 and 90 degrees celsius (loop, validate) …

Member Avatar for Lerner
0
184
Member Avatar for TreeBranches

My program begins by opening a dictionary file, the first line of which contains the number of words in the dictionary. If I print the words immediately after scanning them into the arrays, they appear fine, but if I later examine a previous entry, I can see it has been …

Member Avatar for TreeBranches
0
208
Member Avatar for slygoth

[CODE] FILE *ranch; FILE *myfile; char line[500]; case 1: ranch=fopen("garrudaRanch.txt ","w+"); if(ranch != NULL) { printf("Enter amount of Corral: \n"); scanf("%d",&corral); fprintf(ranch,"%d\n",corral); printf("Enter size of Corral: \n"); scanf("%d",&corrals); fprintf(ranch,"%d\n",corrals); } fclose(ranch); break; case 2: myfile=fopen("garrudaRanch.txt ","r+"); if(myfile != NULL) { //fscanf(myfile,"%s",line[1]); printf("Number of Corral: %s",line[1]); printf("Size of Corral: %s",line[2]); } …

Member Avatar for Ancient Dragon
0
131
Member Avatar for linkingeek

Could you please tell pictorially difference bw these 2 codes(o/p is same) and suggest any source where i can once in for all resolve doubts in pointer to pointer problems except "K&R in ANSI C" [CODE]#include <stdio.h> #include <string.h> void pointer(char**); void main() { char *p[]={"name","fame","claim"}; pointer(p); } void pointer(char …

Member Avatar for versan
0
149
Member Avatar for CombatJ

I am trying to experiment with C++ to make the command prompt function like MatLab or Octave. This is a practice file I've been doing so I could pass functions as parameters to other functions. My problem is with this function call found in line 36 [CODE]compute(gset[function-1], input);[/CODE] This is …

Member Avatar for CombatJ
0
132
Member Avatar for nyxxie

struct looks like this: [CODE] struct ListNode; typedef ListNode* ListType; struct details { char first_name[20]; char last_name[20]; int start_number; int end_number; }; struct ListNode { details data; ListType next; }; ListType list = NULL; ListType head = NULL; ListType * PointerToHead = &head; [/CODE] I have a circular linked list …

0
149
Member Avatar for jwill222

Below is the link to a picture of the debug error window [url]http://www.flickr.com/photos/76298377@N02/6798897020/in/photostream[/url] It's a program that i'm doing and I keep getting this error here's a link to the programming problem. Its' Number 3 [url]http://books.google.com/books?id=bSy1hBCLNl8C&pg=PA335&lpg=PA335&dq=sales.dat+c%2B%2B&source=bl&ots=mmN9b4WzsN&sig=miAD8-u4ly8K1Mou9ZNHv90Nscc&hl=en&sa=X&ei=2wdQT_-4OtSCsgK-l5WyDg&ved=0CDcQ6AEwAg#v=onepage&q=sales.dat%20c%2B%2B&f=false[/url] Why am i getting this error. I'm clueless [CODE] #include <iostream> #include <string> #include<stdio.h> …

Member Avatar for Ketsuekiame
0
111
Member Avatar for ineedsomehelp:3

[CODE]void alternate(char wordWord[][MAX],char wordVar[],int word[],int i,int j, int k, int l) { char ang[4],si[3],ni[3],ay[3],sa[3],kay[4]; int X,Y,Z1,Z2; strcpy(ang,"ang"); strcpy(si,"si"); strcpy(ni,"ni"); strcpy(ay,"ay"); strcpy(sa,"sa"); strcpy(kay,"kay"); tokenize(wordWord,wordVar,word,i,j,k,l); if(wordWord[j][k] == ang[4] || wordWord[j][k] == si[3]) X = wordWord[j][k]; else if(wordWord[j][k] == ni[3]) Z1 = wordWord[j][k]; else if(wordWord[j][k] == ay[3]) Y= wordWord[j][k]; else if(wordWord[j][k] == sa[3] …

Member Avatar for ineedsomehelp:3
0
329
Member Avatar for thache

I've been trying to figure out whats wrong here, but I just can't wrap my head around it. My compiler outputs the following when I attempt to compile it. [CODE] z:\Desktop\tmp\proj4>cl proj4_linkedlist.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. proj4_linkedlist.c …

Member Avatar for thache
0
339
Member Avatar for thorn101

Recently I started learning c and was experimenting with arrays and passing them between functions. Now I have written a simple piece of code which has two functions one for generating random numbers and putting them in an array of size 50 and one function to display the contents of …

Member Avatar for deceptikon
0
160
Member Avatar for Labdabeta

I have some code in C++ that uses an std::vector of std::strings to store an array of strings. I need to convert it into C. I thought that I would just create c versions of the functions I need (vector.back,vector.push_back,string.operator+=) but am getting lost in the double pointers. Can anybody …

Member Avatar for Ancient Dragon
0
176
Member Avatar for shuchi0113

int main(){ int near * ptr=( int *)0XFFFF; ptr++; ptr++; printf(“%p”,ptr); return 0; } Output:0003 why the op is 3 and how to convert 0XFFFF into its decimal equivalent?

Member Avatar for shuchi0113
0
581
Member Avatar for jeffw362

I'm writing a program that takes records(first and last name,id and mark), reads them from a file and inserts the information in StudentRecord structures. For some reason,when I go to list the information, the first and last name strings in each structures are all the same. The first and last …

Member Avatar for nezachem
0
232
Member Avatar for freedomflyer

I am trying to pass some url information into tokenize_urls from process_and_display_information. To get things up and running, I am simply trying to return and retain some array data from tokenize_urls into process_and_display information. However, I am running into an issue where the variables are created and sent back from …

Member Avatar for Ancient Dragon
0
171
Member Avatar for prakhar_cool

[CODE]#include <iostream> using namespace std; class X{ public: int p; }; int main(){ int b; X obj; int X::*ptr = &X::p; obj.p = 100; cout<<obj.p<<endl; cout<<ptr<<endl; cout<<obj.*ptr<<endl; system("pause"); return 0; }[/CODE] When i run this program, i get the output as: 100 1 100. I understand why it shows 100...but …

Member Avatar for rubberman
0
258
Member Avatar for terence193

well i am trying to pass this parameter in a function -->[ICODE]char*[I]filename[/I][/ICODE] [CODE] [U][B]//i just wrote this as an example to explain clearer my question[/B][/U] #include<stdio.h> #include<stdlib.h> void try (char *[I]filename[/I]) //[B] the question is how can i use the pointer to refer to a file? [/B] { printf("try"); } …

Member Avatar for terence193
0
249
Member Avatar for biogig

guys I've been trying to write this lab for my comp sci class for three days now. i've got to the point where it compiles but when I try to run it a table pops up that's says there's an error somewhere in the program that causes it to abort. …

Member Avatar for daviddoria
0
199
Member Avatar for hamby

Hello daniweb, I've been having problems with a program I'm trying to make, in my function definitions, I'm trying to reference the output of one function in the other's definition, but not sure how to, I'm guessing pointers could help me but I'm not sure how to use them: These …

Member Avatar for Moschops
0
154
Member Avatar for Karlwakim

Hi everybody, i am new to c++ and wanna know why pointers are useful ? Why would i use them ? For what ? THANKS

Member Avatar for rubberman
0
160
Member Avatar for mangatmodi

Something is not going right in the following code. I am taking an array of strings from user and printing at the same time. Array can have [B]noe[/B] no. of strings, as noe is entered by user. [CODE]#include <stdio.h> int main(){ char **p; int noe=0,i=0,j=0; scanf("%d", &noe); p=malloc( noe * …

Member Avatar for v3ga
0
150
Member Avatar for methosmen

I'm new to programming and C++. I've managed to succesfully insert multiple nodes from front. Problem is that when printing it starts with the latest node and goes "backwards". I would like it to start with the first node and print forward. Therefore I would like to insert new nodes …

Member Avatar for methosmen
0
267
Member Avatar for tonic22

[CODE]#include <iostream> using namespace std; struct account { account(); int accountnum; float balance; float interestrate; }; account::account() { accountnum = 50; } struct account2 { account2(); account * data; void test(); }; account2::account2() { } void account2::test() { data->accountnum = 1000; } int main() { account test; account2 test2; cout …

Member Avatar for LevyDee
0
127
Member Avatar for CityThrille

Good day everyone. I am back from some previous months of extensive schoolwork. I am creating now a payroll application, but I think there's something wrong in my code, because it created an output that's not my intended output. Wait, guys, I'm confused. Is this appropriate for a C forum …

Member Avatar for CityThrille
0
295
Member Avatar for bennetk2

I am having problem with converting and initializing errors. Any help is appreciated. I am a 2 yr Computer Science major, so be gentle. Here is Code: Sorry its long! [CODE]// Kyle Bennett // CS 318 // Paint Throwing Disturbance #include <iostream> #include <iomanip> // set width and decimal #include …

Member Avatar for raptr_dflo
0
359
Member Avatar for Braindead90

Hi, I am trying to work on creating a linked list of player in a game, but I have not written code in a while and have no idea what I am doing wrong, can you please help with suggestion of what I did wrong or idea of how can …

Member Avatar for jmichae3
0
186
Member Avatar for Braindead90

I am working on creating a linked list to connect the previous value number (or string) to another value I asked this question before I am just guessing I did it completely wrong since no one responded. So what would be the best way to start the function. I need …

Member Avatar for sfuo
0
255
Member Avatar for DmytriE

Hi everyone! In class we just learned about pointers and the their uses. We have been given a project where we need to allocate dynamic memory for any number of matrices (up to four). All four of the matrices addresses are stored in a matrix poiner. All of this must …

0
75
Member Avatar for eviandc

Hi, I'm a beginning C++ student and have an assignment to dynamically create an array of a struct to store students' first names, last names, and test grade scores, and then pass it via pointer to a function that will sort the grades and names in ascending order. I wrote …

Member Avatar for eviandc
0
1K
Member Avatar for arunkumars

Using pointers to structure in C#. I get an error 'Cannot take the address of, or get size, declare a pointer to a managed type' on the line "MyStruct* pMystruct", I have been trying to find out a solution out of this, but in vain. please help me out with …

Member Avatar for nick.crane
0
73
Member Avatar for debuggger

Hey - I'm looking for something similar to using vectors and pointers that I've used before in C++; unfortunately, it doesn't seem like there's an equivalent function in VB.net. What I have is a copy of the array behind a multi-line Rich Text Box, and I need to separate the …

Member Avatar for Reverend Jim
0
184

The End.